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

            Bug ID: 106055
           Summary: [13 Regression] ICE in replace_uses_by, at
                    tree-cfg.cc:1989
           Product: gcc
           Version: 13.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 13.0.0 20220619 snapshot (g:4390e7bfbc641a52c6192b448768dafdf4565527) ICEs
when compiling the following testcase w/ -Os -floop-parallelize-all
-fno-tree-dce:

__attribute__ ((returns_twice)) int
bar (void);

void
quux (void);

void
empty (void)
{
}

unsigned int
choose (unsigned int x, unsigned int y)
{
  return y ? x : 0;
}

int
foo (int *p, unsigned int x, int y)
{
  unsigned int acc = 0;

  empty ();

  while (x)
    {
      bar ();
      ++x;
    }

  while (y)
    acc += y;

  *p = choose (acc, 1);
  quux ();

  return x;
}

% gcc-13.0.0 -Os -floop-parallelize-all -fno-tree-dce -c e2hatkyd.c
during GIMPLE pass: graphite
e2hatkyd.c: In function 'foo':
e2hatkyd.c:19:1: internal compiler error: in replace_uses_by, at
tree-cfg.cc:1989
   19 | foo (int *p, unsigned int x, int y)
      | ^~~
0x73a403 replace_uses_by(tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220619/work/gcc-13-20220619/gcc/tree-cfg.cc:1989
0x1d361b2 canonicalize_loop_closed_ssa
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220619/work/gcc-13-20220619/gcc/graphite.cc:342
0x1d361b2 canonicalize_loop_form
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220619/work/gcc-13-20220619/gcc/graphite.cc:386
0x1d361b2 graphite_transform_loops()
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220619/work/gcc-13-20220619/gcc/graphite.cc:435
0x1d376c0 graphite_transforms
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220619/work/gcc-13-20220619/gcc/graphite.cc:536
0x1d376c0 execute
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220619/work/gcc-13-20220619/gcc/graphite.cc:613

Reply via email to