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: "chrbr at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Feb 2012 16:49:38 +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 #1 from chrbr at gcc dot gnu.org 2012-02-16 16:49:38 UTC ---
Note that the TREE_NO_WARNING is introduced in convert_to_integer:596 while
because of the unsigned-int type conversion in build_c_cast.
A first attempt to fix is to set TREE_NO_WARNING on the constant
(!CAN_HAVE_LOCATION_P) without creating the NOP_EXPR. But Richard explained:
On 02/16/2012 01:58 PM, Richard Guenther wrote:
> You cannot have it on possibly shared tree nodes. CAN_HAVE_LOCATION_P
> tree nodes are not shared (the reverse is not true).
>