[Bug c++/46806] -O3 implies 0 <= 8 <= 7
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 5 04:19:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46806
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-12-05 04:18:55 UTC ---
(In reply to comment #2)
> > 8 is out of range of the enum.
>
> I agree. Unfortunately, with -O3, 8 is reported as in the range.
if a program has undefined behaviour then you shouldn't expect consistent
results at different optimisation levels ... but luckily for you gcc 4.6 is
more forgiving of out-of-range enums
More information about the Gcc-bugs
mailing list