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

            Bug ID: 121334
           Summary: riscv: ICE compiling 523.xalancbmk_r with
                    -fno-vect-cost-model
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rdapp at gcc dot gnu.org
  Target Milestone: ---

When compiling xalancbmk with -O3 -march=rv64gcv_zvl512b -fno-vect-cost-model
we hit gcc_unreachable () in riscv target code, expanding a const vector

(insn 177 176 178 8 (set (reg:V4QI 292)      
        (const_vector:V4QI [                
                (const_poly_int:QI [-2, -8])
                (const_poly_int:QI [-1, -8])
                (const_poly_int:QI [0, -8])
                (const_poly_int:QI [1, -8])  
            ])) "HexBin.cpp":173:27 -1
     (nil))

Apparently this has 2 elements per pattern which we don't handle at all...

The following is a reduced example:

struct HexBin {
  void init();
  char hexNumberTable[];
};

void HexBin::init() {
  int i = 57;
  for (; i >= 48; i--)
    hexNumberTable[i] = i;
}

The issue is also present on the 15 branch.

Reply via email to