https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111699
Bug ID: 111699 Summary: [14 Regression] ICE: SIGSEGV: infinite recursion in fold_build3_loc/fold_ternary_loc/generic_simplify_VEC_ COND_EXPR Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: aarch64-unknown-linux-gnu Created attachment 56054 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56054&action=edit reduced testcase Compiler output: $ aarch64-unknown-linux-gnu-gcc testcase.c -wrapper gdb,-q,--args Reading symbols from /repo/gcc-trunk/binary-trunk-20231005001818-gbf2e66e3ee2-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/14.0.0/cc1... (gdb) r Starting program: /repo/gcc-trunk/binary-trunk-20231005001818-gbf2e66e3ee2-checking-yes-rtl-df-extra-aarch64/libexec/gcc/aarch64-unknown-linux-gnu/14.0.0/cc1 -quiet -iprefix /repo/gcc-trunk/binary-trunk-20231005001818-gbf2e66e3ee2-checking-yes-rtl-df-extra-aarch64/bin/../lib/gcc/aarch64-unknown-linux-gnu/14.0.0/ testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c -mlittle-endian -mabi=lp64 -o /tmp/cc6LuKcc.s [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. const_binop (code=BIT_AND_EXPR, arg1=0x7ffff756a7c8, arg2=0x7ffff756a870) at /repo/gcc-trunk/gcc/fold-const.cc:1358 1358 STRIP_NOPS (arg1); (gdb) bt #0 const_binop (code=BIT_AND_EXPR, arg1=0x7ffff756a7c8, arg2=0x7ffff756a870) at /repo/gcc-trunk/gcc/fold-const.cc:1358 #1 0x0000000000ea0ee6 in const_binop (code=BIT_AND_EXPR, arg1=0x7ffff7212b70, arg2=0x7ffff7213360) at /repo/gcc-trunk/gcc/fold-const.cc:1688 #2 0x0000000000e94ff1 in fold_binary_loc (loc=2147483651, code=<optimized out>, type=0x7ffff7556498, op0=0x7ffff7212b70, op1=0x7ffff7213360) at /repo/gcc-trunk/gcc/fold-const.cc:11129 #3 0x0000000000e9c7fb in fold_build2_loc (loc=2147483651, code=BIT_AND_EXPR, type=0x7ffff7556498, op0=0x7ffff7212b70, op1=0x7ffff7213360) at /repo/gcc-trunk/gcc/fold-const.cc:14040 #4 0x0000000000eae86d in fold_binary_op_with_conditional_arg (loc=2147483651, code=BIT_AND_EXPR, type=0x7ffff7556498, op0=<optimized out>, op1=<optimized out>, cond=<optimized out>, arg=<optimized out>, cond_first_p=1) at /repo/gcc-trunk/gcc/fold-const.cc:7336 #5 0x0000000000e95062 in fold_binary_loc (loc=2147483651, code=<optimized out>, type=0x7ffff7556498, op0=0x7ffff7557640, op1=0x7ffff7213360) at /repo/gcc-trunk/gcc/fold-const.cc:11219 #6 0x0000000000e9c7fb in fold_build2_loc (loc=loc@entry=2147483651, code=code@entry=BIT_AND_EXPR, type=0x7ffff7556498, op0=op0@entry=0x7ffff7557640, op1=op1@entry=0x7ffff7213360) at /repo/gcc-trunk/gcc/fold-const.cc:14040 #7 0x00000000021f9843 in generic_simplify_VEC_COND_EXPR (loc=2147483651, code=<optimized out>, type=0x7ffff7556348, _p0=0x7ffff7211bd0, _p1=0x7ffff756a7e0, _p2=0x7ffff756a7f8) at generic-match-2.cc:8731 #8 0x0000000000eabf3b in fold_ternary_loc (loc=2147483651, code=VEC_COND_EXPR, type=0x7ffff7556348, op0=0x7ffff7211bd0, op1=0x7ffff756a7e0, op2=0x7ffff756a7f8) at /repo/gcc-trunk/gcc/fold-const.cc:13028 #9 0x0000000000eadeb8 in fold_build3_loc (loc=loc@entry=2147483651, code=code@entry=VEC_COND_EXPR, type=type@entry=0x7ffff7556348, op0=0x7ffff7211bd0, op1=op1@entry=0x7ffff756a7e0, op2=op2@entry=0x7ffff756a7f8) at /repo/gcc-trunk/gcc/fold-const.cc:14100 #10 0x00000000021f985e in generic_simplify_VEC_COND_EXPR (loc=2147483651, code=<optimized out>, type=0x7ffff7556348, _p0=0x7ffff7211ba0, _p1=0x7ffff756a7e0, _p2=0x7ffff756a7f8) at generic-match-2.cc:8739 #11 0x0000000000eabf3b in fold_ternary_loc (loc=2147483651, code=VEC_COND_EXPR, type=0x7ffff7556348, op0=0x7ffff7211ba0, op1=0x7ffff756a7e0, op2=0x7ffff756a7f8) at /repo/gcc-trunk/gcc/fold-const.cc:13028 #12 0x0000000000eadeb8 in fold_build3_loc (loc=loc@entry=2147483651, code=code@entry=VEC_COND_EXPR, type=type@entry=0x7ffff7556348, op0=0x7ffff7211ba0, op1=op1@entry=0x7ffff756a7e0, op2=op2@entry=0x7ffff756a7f8) at /repo/gcc-trunk/gcc/fold-const.cc:14100 ... $ aarch64-unknown-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-13-branch/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-13-branch/binary-13-branch-20231001002158-gf8353d6a7cd-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/13.2.1/lto-wrapper Target: aarch64-unknown-linux-gnu Configured with: /repo/gcc-13-branch//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu --with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld --with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-13-branch//binary-13-branch-20231001002158-gf8353d6a7cd-checking-yes-rtl-df-extra-aarch64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.2.1 20231001 (GCC)