This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21636] New: Missed ccp optimization
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2005 22:09:01 -0000
- Subject: [Bug tree-optimization/21636] New: Missed ccp optimization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code we miss one ccp optimization:
struct f
{
int i;
};
int g()throw()
{
f a;
a.i = 1;
f *a1 = &a;
int *i = &a1->i;
return *i; /* This should be turned into a.i */
}
We get right now:
Visiting statement:
a1_3 = &a;
Lattice value changed to CONSTANT &a. Adding SSA edges to worklist.
Visiting statement:
i_4 = &a1_3->i;
Lattice value changed to VARYING. Adding SSA edges to worklist.
Adding Destination of edge (0 -> 2) to worklist
we should see that the lattice value for &a1_3->i is really constant if a1_3 is constant.
--
Summary: Missed ccp optimization
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21636