https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81661
--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> --- On Sat, 28 Oct 2017, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81661 > > --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > (In reply to Richard Biener from comment #5) > > One possibility is instead of using > > > > may_be_zero ? 0 : niter > > > > as niter for code-generation use > > > > (may_be_zero ? 0 : 1) * niter > > > > This avoids the gimplification issue. We assemble this as > > > > call __addvsi3 > > movl %eax, %esi > > subl %ebp, %esi > > cmpl %ebp, %eax > > setge %al > > movzbl %al, %eax > > imull %eax, %esi > > > > so it definitely is ugly (we're lacking any pattern matching on this > > turning it back to a COND_EXPR). > > r250377 added a pattern which should have caught that ... I suspect we're missing cond ? 0 : 1 -> (int) cond for it to trigger.