https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111280
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- force_gimple_operand will never create basic-blocks but instead makes scalar code with a COND_EXPR rhs. There's no existing infrastructure to handle this, "pre-scanning" the GENERIC, splitting it at COND_EXPR points, might be a way to fix this. Note what niter analysis produces either is wrong or gimplification isn't conservative enough with if (gimplify_ctxp->allow_rhs_cond_expr /* If either branch has side effects or could trap, it can't be evaluated unconditionally. */ && !TREE_SIDE_EFFECTS (then_) && !generic_expr_could_trap_p (then_) && !TREE_SIDE_EFFECTS (else_) && !generic_expr_could_trap_p (else_)) return gimplify_pure_cond_expr (expr_p, pre_p); since that doesn't consider conditional undefined behavior. Note fixing that would then ICE or build gotos/labels (we could then use sth like find_many_sub_bbs on).