Skip to content

Commit

Permalink
Weaken assert around folding constants (#103026)
Browse files Browse the repository at this point in the history
I ran into this assert with native AOT. It seems to be too strong - we are not allowed to fold IconHandle constants with prejit.
  • Loading branch information
MichalStrehovsky authored Jun 4, 2024
1 parent a7c88a2 commit 0e107cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9426,7 +9426,8 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac, bool* optA
}

/* Any constant cases should have been folded earlier */
noway_assert(!op1->OperIsConst() || opts.OptimizationDisabled() || optValnumCSE_phase);
noway_assert(!op1->OperIsConst() || op1->IsIconHandle() || opts.OptimizationDisabled() ||
optValnumCSE_phase);
break;

case GT_CKFINITE:
Expand Down

0 comments on commit 0e107cd

Please sign in to comment.