http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680
Jason Merrill jason at gcc dot gnu.org changed:
What|Removed |Added
Known to fail||
--- Comment #19
--- Comment #17 from jason at gcc dot gnu dot org 2010-05-03 21:16 ---
Subject: Bug 43680
Author: jason
Date: Mon May 3 21:16:40 2010
New Revision: 159006
URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159006
Log:
PR c++/43680
gcc:
* c.opt (-fstrict-enums): New.
--- Comment #18 from jason at gcc dot gnu dot org 2010-05-04 04:44 ---
Fixed for 4.6.0.
--
jason at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #13 from mmitchel at gcc dot gnu dot org 2010-04-20 20:43
---
I think this optimization is valuable in some cases, so I think this is a
question of defaults, rather than of behavior per se. While it may be useful
for some security-related applications not to eliminate the
--- Comment #14 from jason at gcc dot gnu dot org 2010-04-20 22:02 ---
Certainly optimizing away bounds checking is good when it is provably
redundant, but that clearly doesn't apply to this case. That said, I'll go
ahead and add the option.
--
--- Comment #15 from mark at codesourcery dot com 2010-04-20 22:18 ---
Subject: Re: [DR 1022] G++ is too aggressive in optimizing
away bounds checking with enums
jason at gcc dot gnu dot org wrote:
Certainly optimizing away bounds checking is good when it is provably
redundant,
--- Comment #16 from jason at gcc dot gnu dot org 2010-04-20 23:10 ---
I agree that it's similar to signed integer overflow. One significant
difference is that this issue doesn't affect C.
One strange thing here is that the VRP optimization only happens when the enum
variable is