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

            Bug ID: 104676
           Summary: [12 Regression] ICE in verify_loop_structure, at
                    cfgloop.cc:1748 (error: loop 3's number of iterations
                    '(unsigned int) + 4294967295' references the released
                    SSA name '<unknown>')
           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: ---

gcc 12.0.1 20220220 snapshot (g:e49508ac6b36adb8a2056c5a1fb6e0178de2439d) ICEs
when compiling the following testcase w/ -O1 -ftree-loop-distribution
-ftree-parallelize-loops=2:

struct S {
  int f;
};

int n;

int
foo (struct S *s)
{
  int arr[3];
  int v = 0;

  for (n = 0; n < 2; ++n)
    {
      int i;

      for (i = 0; i < 2; ++i)
        {
          int j;

          for (j = 0; j < s->f; ++j)
            ++v;
        }

      if (v)
        arr[0] = 0;

      arr[n + 1] = 0;
    }

  return arr[0];
}

% gcc-12.0.1 -O1 -ftree-loop-distribution -ftree-parallelize-loops=2 -c
opcatmkb.c
opcatmkb.c: In function 'foo':
opcatmkb.c:8:1: error: loop 3's number of iterations '(unsigned int) +
4294967295' references the released SSA name '<unknown>'
    8 | foo (struct S *s)
      | ^~~
during GIMPLE pass: ldist
opcatmkb.c:8:1: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1748
0x68eb89 verify_loop_structure()
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/cfgloop.cc:1748
0xf752ee checking_verify_loop_structure
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/cfgloop.h:646
0xf752ee loop_distribution::execute(function*)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/tree-loop-distribution.cc:3861
0xf7551b execute
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220220/work/gcc-12-20220220/gcc/tree-loop-distribution.cc:3905

Reply via email to