This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates
- From: "jamborm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Jun 2011 22:18:20 +0000
- Subject: [Bug tree-optimization/49599] New: FRE/DSE not performing well on aggregates
- Auto-submitted: auto-generated
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.