[Bug optimization/14843] New: propagate a cast back to PHI

kazu at cs dot umass dot edu gcc-bugzilla@gcc.gnu.org
Sun Apr 4 10:34:00 GMT 2004


void bar (void);

int
foo (int a)
{
  char c;
  if (a == 123)
    c = 30;
  else
    c = 47;
  return (int) c;
}

I get:

foo (a)
{
  char c;

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

<L0>:;

  # c_1 = PHI <47(0), 30(1)>;
<L2>:;
  return (int)c_1;

}

If everything in PHI are constants (as in this case), we should be able
to absorb the following cast in the PHI.

This is somewhat related to PR 14797.

-- 
           Summary: propagate a cast 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=14843



More information about the Gcc-bugs mailing list