https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97979
Bug ID: 97979 Summary: internal compiler error: Segmentation fault with "-O3 -fno-toplevel-reorder -fno-tree-ccp" Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: suochenyao at 163 dot com Target Milestone: --- ******************************************************************************* OS and Platform: CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux ******************************************************************************* Program: short a=0; int b=0; void c() { unsigned short d = b; a = d >> 18446744073709551614; } int main() {} ******************************************************************************* gcc version: $ gcc -v Using built-in specs. COLLECT_GCC=/home/suocy/bin/gcc-dev/bin/gcc COLLECT_LTO_WRAPPER=/home/suocy/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/suocy/bin/gcc-dev/ --disable-multilib --enable-languages=c,c++ Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20201124 (experimental) (GCC) ******************************************************************************* Command Lines: $ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -O3 -fno-toplevel-reorder -fno-tree-ccp a.c a.c: In function ācā: a.c:5:12: warning: integer constant is so large that it is unsigned 5 | a = d >> 18446744073709551614; | ^~~~~~~~~~~~~~~~~~~~ a.c:5:9: warning: right shift count >= width of type [-Wshift-count-overflow] 5 | a = d >> 18446744073709551614; | ^~ during GIMPLE pass: forwprop a.c:3:6: internal compiler error: Segmentation fault 3 | void c() { | ^ 0xdeaf5f crash_signal ../../gcc/toplev.c:330 0xab3770 tree_swap_operands_p(tree_node const*, tree_node const*) ../../gcc/fold-const.c:7398 0x1224d14 gimple_resimplify2 ../../gcc/gimple-match-head.c:298 0x128c1ea gimple_simplify_100 /home/suocy/src/gcc-dev/gcc/build/gcc/gimple-match.c:6581 0x128cedf gimple_simplify_RSHIFT_EXPR /home/suocy/src/gcc-dev/gcc/build/gcc/gimple-match.c:107758 0x1224dac gimple_resimplify2 ../../gcc/gimple-match-head.c:318 0x126535a gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) ../../gcc/gimple-match-head.c:957 0xb20aee fold_stmt_1 ../../gcc/gimple-fold.c:5930 0xf13111 execute ../../gcc/tree-ssa-forwprop.c:3103 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.