https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84608
Bug ID: 84608 Summary: Hang in cxx_eval_constant_expression() with -fsanitize=undefined Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: vegard.nossum at gmail dot com Target Milestone: --- Created attachment 43525 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43525&action=edit GDB stack trace Input: void f(void) { return { 00 + 0 << 101 >> 2 + 0 >> 0 >> ~010 + 0 << 0 >> ~~00 << 1 << ~~0 + ~010 + 0 << 0 << 0 + 0 + 0 >> 0 + ~0 << ~0 + 22 + 2120 + ~0 >> 200 << 01 >> 10 << ~0 + 0 >> 0 << 0 >> 210 >> 0 << ~100 + 0 >> 0 << 1021 + 10 >> 02 >> 0 >> 2 + 20 }; } Output: $ xgcc -x c++ -fsanitize=undefined -c - <stdin>: In function 'void f()': <stdin>:2:21: warning: left shift count >= width of type [-Wshift-count-overflow] <stdin>:2:49: warning: right shift count is negative [-Wshift-count-negative] <stdin>:2:85: warning: left shift count is negative [-Wshift-count-negative] <stdin>:2:113: warning: right shift count is negative [-Wshift-count-negative] <stdin>:2:136: warning: left shift count >= width of type [-Wshift-count-overflow] <stdin>:2:141: warning: right shift count >= width of type [-Wshift-count-overflow] <stdin>:2:165: warning: left shift count is negative [-Wshift-count-negative] <stdin>:2:180: warning: right shift count >= width of type [-Wshift-count-overflow] [hang] Version: xgcc (GCC) 8.0.1 20180204 (experimental) built from git fdae6180ad24fa6303fa046114f3e4b66b8db34d It seems to have been introduced somewhere between 5.5.0 and 6.1.0. Please see attachment for gdb stack trace.