This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates


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

           Summary: FRE/DSE not performing well on aggregates
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jamborm@gcc.gnu.org


In the following testcase:

struct S
{
  int i;
  unsigned short f1;
  char f2;
  unsigned short f3[2], f4;
};

int foo (struct S *p)
{
  struct S l;

  l = *p;
  l.i++;
  *p = l;
}

in which SRA does not do total scalarization because of the array in
the aggregate (we do it only for structures), the optimized dump looks
like this:

foo (struct S * p)
{
  int l$i;
  struct S l;
  int D.1967;

<bb 2>:
  l = *p_1(D);
  l$i_6 = p_1(D)->i;
  D.1967_3 = l$i_6 + 1;
  *p_1(D) = l;
  p_1(D)->i = D.1967_3;
  return;
}

The loads and stores from and to l should be eliminated, probably by
FRE and DSE.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]