[Bug optimization/14797] New: [tree-ssa] propagate constants back to PHI

kazu at cs dot umass dot edu gcc-bugzilla@gcc.gnu.org
Wed Mar 31 10:46:00 GMT 2004


Consider:

int
foo (int a)
{
  int b;

  if (a == 0)
    b = 0;
  else
    b = 1;

  return b + 1;
}

I get:

foo (a)
{
  int b;

<bb 0>:
  if (a_2 == 0) goto <L0>; else goto <L2>;

<L0>:;

  # b_1 = PHI <1(0), 0(1)>;
<L2>:;
  return b_1 + 1;

}

Note that PHI could absorb b_1 + 1.  That is, we could do something like:

foo (a)
{
  int b;

<bb 0>:
  if (a_2 == 0) goto <L0>; else goto <L2>;

<L0>:;

  # b_1 = PHI <2(0), 1(1)>;
<L2>:;
  return b_1;

}

-- 
           Summary: [tree-ssa] propagate constants back to PHI
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: enhancement
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14797



More information about the Gcc-bugs mailing list