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

            Bug ID: 102318
           Summary: [12 Regression] ICE: verify_gimple failed (error:
                    incompatible types in 'PHI' argument 1)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

gcc-12.0.0-alpha20210912 snapshot (g:53a4def0dc1aac39d592a0d20e9ec16e8b5574ac)
ICEs when compiling the following testcase, extracted from
gcc/testsuite/gcc.target/aarch64/sve/slp_7.c, w/ -O1 -ftree-loop-vectorize:

void
vec_slp_int16_t (short int *restrict a, short int *restrict b, int n)
{
  short int x0 = b[0];
  short int x1 = b[1];
  short int x2 = b[2];
  short int x3 = b[3];
  for (int i = 0; i < n; ++i)
  {
    x0 += a[i * 4];
    x1 += a[i * 4 + 1];
    x2 += a[i * 4 + 2];
    x3 += a[i * 4 + 3];
  }
  b[0] = x0;
  b[1] = x1;
  b[2] = x2;
  b[3] = x3;
}

% aarch64-linux-gnu-gcc-12.0.0 -O1 -ftree-loop-vectorize -c n8srjast.c
n8srjast.c: In function 'vec_slp_int16_t':
n8srjast.c:2:1: error: incompatible types in 'PHI' argument 1
    2 | vec_slp_int16_t (short int *restrict a, short int *restrict b, int n)
      | ^~~~~~~~~~~~~~~
vector(4) unsigned short

vector(4) short int

_196 = PHI <_195(17), _188(11)>
during GIMPLE pass: vect
n8srjast.c:2:1: internal compiler error: verify_gimple failed
0xf76827 verify_gimple_in_cfg(function*, bool)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210912/work/gcc-12-20210912/gcc/tree-cfg.c:5576
0xe33bc6 execute_function_todo
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210912/work/gcc-12-20210912/gcc/passes.c:2042
0xe3418b execute_todo
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_alpha20210912/work/gcc-12-20210912/gcc/passes.c:2096

Reply via email to