https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117915

            Bug ID: 117915
           Summary: ICE on valid code at -O{s,2,3} with
                    "-fno-tree-copy-prop -fno-tree-vrp" on
                    x86_64-linux-gnu: tree check: expected ssa_name, have
                    integer_cst in ifcombine_mark_ssa_name, at
                    tree-ssa-ifcombine.cc:478
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a recent regression as it doesn't reproduce with 14.2 and
earlier.

Compiler Explorer: https://godbolt.org/z/nrdcez6GP


[533] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241204 (experimental) (GCC) 
[534] % 
[534] % gcctk -O3 -fno-tree-copy-prop -fno-tree-vrp small.c
during GIMPLE pass: ifcombine
small.c: In function ‘main’:
small.c:3:5: internal compiler error: tree check: expected ssa_name, have
integer_cst in ifcombine_mark_ssa_name, at tree-ssa-ifcombine.cc:478
    3 | int main() {
      |     ^~~~
0x26d34e5 internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:517
0x913ad7 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc-trunk/gcc/tree.cc:9038
0x8d013b tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc-trunk/gcc/tree.h:3665
0x8d013b ifcombine_mark_ssa_name
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:478
0x8d013b ifcombine_mark_ssa_name
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:476
0x1380242 ifcombine_replace_cond
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:648
0x1381b60 ifcombine_ifandif
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:1007
0x138261c tree_ssa_ifcombine_bb_1
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:1095
0x1382ada tree_ssa_ifcombine_bb
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:1195
0x1382ada execute
        ../../gcc-trunk/gcc/tree-ssa-ifcombine.cc:1388
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[535] % 
[535] % cat small.c
unsigned a;
int b, c;
int main() {
  a = a & b || (c || b) | a;
  return 0;
}

Reply via email to