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

            Bug ID: 71621
           Summary: [7 Regression] ICE in assign_by_spills, at
                    lra-assigns.c:1417 (error: unable to find a register
                    to spill) w/ -O2 -mavx2 -ftree-vectorize
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: ra
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
                CC: uros at gcc dot gnu.org, vmakarov at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-pc-linux-gnu

gcc-7.0.0-alpha20160619 snapshot fails to compile the following reduced
testcase w/ -O2 -mavx2 -ftree-vectorize:

int cn;
int *li;

void
y8 (void)
{
  int gv;
  int *be = &gv;
  short int v4 = 2;

  while (*li != 0)
    {
      int sy;
      for (sy = 0; sy < 5; ++sy)
        {
          int **t6 = &be;
          gv |= sy ? 0 : v4;
          if (gv != 0)
            ++gv;
          t6 = &cn;
          if (gv != 0)
            *t6 = 0;
        }
      for (gv = 0; gv < 24; ++gv)
        v4 |= 1 <= 1 % 0;
      ++(*li);
    }
}

% x86_64-pc-linux-gnu-gcc-7.0.0-alpha20160619 -w -c -O2 -mavx2 -ftree-vectorize
nl1c5wer.c
nl1c5wer.c: In function 'y8':
nl1c5wer.c:28:1: error: unable to find a register to spill
 }
 ^
nl1c5wer.c:28:1: error: this is the insn:
(insn 35 177 37 3 (set (reg:V16HI 136)
        (vec_duplicate:V16HI (reg:HI 199))) 4217 {*vec_dupv16hi}
     (expr_list:REG_DEAD (reg:HI 199)
        (nil)))
nl1c5wer.c:28:1: internal compiler error: in assign_by_spills, at
lra-assigns.c:1417

Changing -mavx2 to -march=haswell results in the following:

% x86_64-pc-linux-gnu-gcc-7.0.0-alpha20160619 -w -c -O2 -march=haswell
-ftree-vectorize nl1c5wer.c    
nl1c5wer.c: In function 'y8':
nl1c5wer.c:28:1: internal compiler error: Max. number of generated reload insns
per insn is achieved (90)

Reply via email to