[Bug c/52283] "error: case label does not reduce to an integer constant" for constant folded cast expr

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 16 23:56:00 GMT 2012


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).



More information about the Gcc-bugs mailing list