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


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