https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110886
Bug ID: 110886
Summary: [14 Regression] ICE on linux-6.4.7: SIGSEGV on
gimple_bitwise_inverted_equal_p (infinite recursion?)
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: slyfox at gcc dot gnu.org
Target Milestone: ---
Initially observed compiler crash on linux-6.4.7 when building with
r14-2930-g0460c122162793.
Extracted reproducer:
$ gcc -c altera.c.c -o altera.o -O2
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Note: it fails to print the backtrace probably due to infinite recursion:
Program received signal SIGSEGV, Segmentation fault.
0x00000000009835c9 in operand_compare::verify_hash_value (this=0x262d168
<default_compare_instance>, arg0=0x7ffff760df30,
arg1=0x7ffff7625168, flags=0, ret=0x7ffffbfff037) at
../../source/gcc/fold-const.cc:4068
4068 ../../source/gcc/fold-const.cc: No such file or directory.
(gdb) bt
#0 0x00000000009835c9 in operand_compare::verify_hash_value (this=0x262d168
<default_compare_instance>, arg0=0x7ffff760df30,
arg1=0x7ffff7625168, flags=0, ret=0x7ffffbfff037) at
../../source/gcc/fold-const.cc:4068
#1 0x0000000000983d98 in operand_compare::operand_equal_p (flags=<optimized
out>, arg1=<optimized out>, arg0=<optimized out>,
this=0x262d168 <default_compare_instance>) at
../../source/gcc/fold-const.cc:3090
#2 operand_equal_p (arg0=0x7ffff760df30, arg1=0x7ffff7625168, flags=0) at
../../source/gcc/fold-const.cc:4105
#3 0x0000000001aee18e in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff760df30, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:284
#4 0x0000000001aee1e4 in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff77dc000, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:289
#5 0x0000000001aee1e4 in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff760df30, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:289
#6 0x0000000001aee1e4 in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff77dc000, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:289
#7 0x0000000001aee1e4 in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff760df30, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:289
#8 0x0000000001aee1e4 in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff77dc000, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:289
#9 0x0000000001aee1e4 in gimple_bitwise_inverted_equal_p
(expr1=0x7ffff760df30, expr2=expr2@entry=0x7ffff7625168,
valueize=valueize@entry=0xe9b9b0 <rpo_vn_valueize(tree_node*)>) at
../../source/gcc/gimple-match-head.cc:289
...
$ gcc -v
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-14.0.0/bin/gcc
COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-14.0.0/libexec/gcc/x86_64-unknown-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../source/configure --prefix=/<<NIX>>/gcc-14.0.0
--with-gmp-include=/<<NIX>>/gmp-6.3.0-dev/include
--with-gmp-lib=/<<NIX>>/gmp-6.3.0/lib
--with-mpfr-include=/<<NIX>>/mpfr-4.2.0-dev/include
--with-mpfr-lib=/<<NIX>>/mpfr-4.2.0/lib --with-mpc=/<<NIX>>/libmpc-1.3.1
--with-native-system-header-dir=/<<NIX>>/glibc-2.38-dev/include
--with-build-sysroot=/ --program-prefix= --enable-lto --disable-libstdcxx-pch
--without-included-gettext --with-system-zlib --enable-checking=release
--enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin
--disable-libcc1 --with-isl=/<<NIX>>/isl-0.20 --disable-bootstrap
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=x86_64-unknown-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 99999999 (experimental) (GCC)