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 sanitizer/66880] 'error: case label does not reduce to an integer constant' with -fsanitize=shift -std=gnu99.


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.


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