https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101466
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-07-15 Status|UNCONFIRMED |NEW Severity|normal |enhancement Keywords| |missed-optimization Summary|Optimizers should fold |Optimizers should fold |bounds checking for |bounds checking for |-D_GLIBCXX_ASSERTIONS=1 + |-D_GLIBCXX_ASSERTIONS=1 |--disable-libstdcxx-verbose | Ever confirmed|0 |1 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: extern void g() __attribute__((noreturn)); void square(int t, int *tt) { if (t == 0) g(); tt[0] = 0; if (t == 1) g(); tt[1] = 0; if (t == 2) g(); tt[2] = 0; if (t == 3) g(); tt[3] = 0; if (t == 4) g(); tt[4] = 0; }