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

            Bug ID: 116831
           Summary: [15 Regression] ICE with trunk mod vectorising for SVE
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

long a;
int b, c;
void d(int e[][5], short f[][5][5][5]) {
  for (short g; g; g += 4)
    a = c ?: e[6][0] % b ? 0 : f[0][0][0][g];
}

-O3 -march=armv9-a

0x252429b internal_error(char const*, ...)
        $SRC/gcc/diagnostic-global-context.cc:517
0x80fbff fancy_abort(char const*, int, char const*)
        $SRC/gcc/diagnostic.cc:1512
0x7fdd1f poly_int<2u, unsigned long>::to_constant() const
        $SRC/gcc/poly-int.h:592
0x158c287 poly_int<2u, unsigned long>::to_constant() const
        $SRC/gcc/poly-int.h:590
0x158c287 nunits_for_known_piecewise_op
        $SRC/gcc/tree-vect-generic.cc:96
0x158c287 expand_vector_piecewise
        $SRC/gcc/tree-vect-generic.cc:290
0x158ee13 expand_vector_operation
        $SRC/gcc/tree-vect-generic.cc:1257
0x158fdf7 expand_vector_operations_1
        $SRC/gcc/tree-vect-generic.cc:2366
0x158fdf7 expand_vector_operations
        $SRC/gcc/tree-vect-generic.cc:2400
0x158fdf7 execute
        $SRC/gcc/tree-vect-generic.cc:2454
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.

I suppose it's related to PR101390 but the vectoriser dump looks odd to me:
...
  vect_cst__214 = [vec_duplicate_expr] _213;
  vect_cst__215 = [vec_duplicate_expr] b.2_3;
  _223 = (sizetype) f_16(D);
  _232 = niters.11_182 - POLY_INT_CST [4, 4];

  <bb 4> [local count: 382252093]:
  # g_22 = PHI <g_19(10), g_12(D)(24)>
  # vect_vec_iv_.13_209 = PHI <_212(10), _207(24)>
  # ivtmp_233 = PHI <ivtmp_234(10), 0(24)>
  _210 = (vector([4,4]) unsigned short) vect_vec_iv_.13_209;
  _211 = _210 + { POLY_INT_CST [16, 16], ... };
  _212 = (vector([4,4]) short int) _211;
  vect_patt_82.14_216 = vect_cst__214 / vect_cst__215;
  vect_patt_83.15_218 = vect_cst__215 * vect_patt_82.14_216;
  vect_patt_84.16_219 = vect_cst__214 - vect_patt_83.15_218; // SYNTHESISED
VECTOR MOD
  _4 = _213 % b.2_3; // ORIGINAL STMT to be DCE'ed
  _235 = vect_cst__214 % vect_cst__215; // ?????
...
The ICEing statement is hte one marked ?????. I'm not sure why that's created
but as it's a VLA vector statement it chokes on vector lowering as we don't
support VLA lowering there

Reply via email to