http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48418

--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> 2011-04-03 11:21:27 UTC ---
It's deliberate that folding of references to const variables is now 
delayed - and ideally it would move out of the front end altogether.  
While decl_constant_value_for_optimization still exists it would be easy 
enough to have a second check for this warning in c_fully_fold_internal, 
but in general the alternatives (which are not mutually exclusive) are 
predictable warnings in the front end that may not catch all cases and may 
sometimes warn in unreachable code, and less-predictable middle-end 
warnings if the problem operation is reachable (here, if a shift by an 
out-of-range constant is found after optimization, which could include 
where the variable with the shift amount isn't marked const).

Reply via email to