https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96373
--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 5 Aug 2020, rsandifo at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96373 > > --- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> > --- > FWIW, I think the reason I mentioned for skimping on this originally > was that we don't e.g. prevent if-conversion of: > > void > foo (int *c, float *f) > { > for (int i = 0; i < 16; ++i) > f[i] = c[i] ? __builtin_sqrtf (f[i]) : f[i]; > } > > for -O2 -ftree-vectorize -fno-math-errno. So it seemed like things > weren't very consistent. I think that's a bug in if-conversion - gimple_could_trap_p only says that the call instruction itself doesn't trap, it doesn't say anything about something in the callee body. You should need -fno-trapping-math to get the above if-converted.