This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52283] "error: case label does not reduce to an integer constant" for constant folded cast expr
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Feb 2012 23:52:21 +0000
- Subject: [Bug c/52283] "error: case label does not reduce to an integer constant" for constant folded cast expr
- Auto-submitted: auto-generated
- References: <bug-52283-4@http.gcc.gnu.org/bugzilla/>
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).