This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/66880] 'error: case label does not reduce to an integer constant' with -fsanitize=shift -std=gnu99.
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Jul 2015 14:38:36 +0000
- Subject: [Bug sanitizer/66880] 'error: case label does not reduce to an integer constant' with -fsanitize=shift -std=gnu99.
- Auto-submitted: auto-generated
- References: <bug-66880-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66880
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yeah, the problem is that a case label value needs to be an integral constant
expression. 0xEB << 24 contains an overflow so we weren't able to fold it,
thus we emit the __builtin___ubsan_handle_shift_out_of_bounds call -- and that
is rejected by the C FE later on. I'm not sure how to make this better.