[Bug tree-optimization/56610] New: IPA(-CP) clone materialization fails to cleanup the CFG

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 13 09:47:00 GMT 2013


             Bug #: 56610
           Summary: IPA(-CP) clone materialization fails to cleanup the
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
                CC: hubicka@gcc.gnu.org

__attribute__((noinline)) static int
foo (int x)
  int i = 1;
  if (x > 1)
      bar (i);
    while (++i != x);

baz (void)
  foo (1);
  foo (1);
  foo (1);

We can see a

  if (1 == 0)

survive for a long time.  When IPA-CP get's the chance to look at the
clones body in ipcp_transform_function there is nothing that changes
the CFG and thus it doesn't queue a cfg-cleanup to fix up the above
(which is created by clone materialization itself).

Now we can just unconditionally schedule a cfg-cleanup after IPA-CP,
but really all those "todo"s should queue up for all IPA transforms
(including fixup-cfg, which should be a IPA transform-only pass in the
IPA pipeline).

More information about the Gcc-bugs mailing list