This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/50266] [4.6/4.7 Regression] internal compiler error: in decode_addr_const, at varasm.c:2638


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

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-09-02 13:36:20 UTC ---
I don't think there's any particular reason this initializer should need 
to be folded in a particular way by the front end; I'd think the front 
end's job is to produce a valid GENERIC initializer, whether or not 
folded, with folding to something visibly constant only required if the 
object initialized is of static storage duration.  If you make x static 
then it builds OK (although it's not required to) but in C99 an aggregate 
initializer of automatic storage duration can have non-constant elements 
even if the type of the aggregate is a const-qualified type (that is, x is 
initialized once and constant after that).  In fact you get the same ICE 
when x isn't marked const at all.  (And in general the middle-end ought to 
be prepared to see aggregate initializers that become constant after 
constant propagation but aren't known by the front end to be constant.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]