https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110228
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #13) > has undefined behavior in it? Right now we remove the whole `!= 0` if we use > with -O2. Yes, it is UB. You'd need first array element of 0 to make it valid.