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

            Bug ID: 119640
           Summary: ICE: verify_ssa failed error compiling gem5 since
                    r15-3509-gd34cda72098867
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

While compiling gem5 with a recent trunk we hit a "error: definition in block
18 does not dominate use in block 2" verify_ssa failed ICE when using -O2
-funswitch-loops.  I used cvise to reduce the LARGE test case down to something
a little more manageable:

bergner@kubota:$ cat gem5-test-reduced.ii 
typedef int uint32_t;
struct shared_ptr {
  shared_ptr(decltype(nullptr));
};
int execute___trans_tmp_4, mask_nbits;
typedef shared_ptr Fault;
decltype(nullptr) NoFault;
class ExecContext;
namespace trace {
class InstRecord;
}
template <class> struct SriQX {
  Fault execute(ExecContext *, trace::InstRecord *) const {
    long __trans_tmp_2;
    Fault fault = NoFault;
    const unsigned eCount = sizeof(int);
    union {
      uint32_t regs[4];
      int elements[eCount];
    } destReg;
    for (unsigned i = 0; i < eCount; i++) {
      if (imm)
        __trans_tmp_2 = 1ULL << mask_nbits;
      destReg.elements[i] = __trans_tmp_2;
      execute___trans_tmp_4 = destReg.regs[0];
    }
    return fault;
  }
  long imm;
};
template Fault SriQX<uint32_t>::execute(ExecContext *,
                                        trace::InstRecord *) const;

bergner@kubota:GEM5-BISECT$ /opt/gcc-nightly/trunk/bin/g++ -S -O2
-funswitch-loops gem5-test-reduced.ii
gem5-test-reduced.ii: In member function ‘Fault SriQX< <template-parameter-1-1>
>::execute(ExecContext*, trace::InstRecord*) const [with
<template-parameter-1-1> = int]’:
gem5-test-reduced.ii:13:9: error: definition in block 18 does not dominate use
in block 2
   13 |   Fault execute(ExecContext *, trace::InstRecord *) const {
      |         ^~~~~~~
for SSA_NAME: vect_cst__40 in statement:
vect__3.9_41 = { 1, 1 } << vect_cst__40;
during GIMPLE pass: vect
gem5-test-reduced.ii:13:9: internal compiler error: verify_ssa failed
0x12653f2f internal_error(char const*, ...)
        /home/gccbuild/gcc_trunk_git/gcc/gcc/diagnostic-global-context.cc:517
0x114f2eff verify_ssa(bool, bool)
        /home/gccbuild/gcc_trunk_git/gcc/gcc/tree-ssa.cc:1203
0x10fdf5cf execute_function_todo
        /home/gccbuild/gcc_trunk_git/gcc/gcc/passes.cc:2108
0x10fdfe57 execute_todo
        /home/gccbuild/gcc_trunk_git/gcc/gcc/passes.cc:2155
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.

A git bisect identifies richi's "Handle non-grouped stores as single-lane SLP"
commit as the culprit.  r15-3509-gd34cda72098867

Reply via email to