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 c/52283] "error: case label does not reduce to an integer constant" for constant folded cast expr


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

--- Comment #10 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-02-16 23:52:21 UTC ---
On Thu, 16 Feb 2012, manu at gcc dot gnu.org wrote:

> Talking about this particular case (folding in build_c_cast), is this actually
> needed here? Couldn't GCC just delay folding until actually needed?

The only c_fully_fold call in build_c_cast is when a CONSTRUCTOR is 
generated from a cast to union (a GNU extension).  That's a case of 
avoiding any problems recursing later inside CONSTRUCTORs (which are not 
particularly normal expressions).  The option to delay would be to have 
some other representation of that cast which is only later lowered to a 
CONSTRUCTOR (with the inside expression being folded at that later time).


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