This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23619] New: Missed pre opportunity
- From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2005 09:02:19 -0000
- Subject: [Bug tree-optimization/23619] New: Missed pre opportunity
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
On the following testcase:
int a[100];
void foo(int p, int q)
{
int i;
for (i = 0; i < 100; i++)
if (i & 8)
a[i] = (p + q) + 2;
else
a[i] = (p + q) + 4;
}
I expected (p+q) to be moved out of loop by pre, but it does not happen. At
first I thought this is caused by reassociation, which modifies the loop to
for (i = 0; i < 100; i++)
if (i & 8)
a[i] = (p + 2) + q;
else
a[i] = (p + 4) + q;
But even with reassociation disabled, PRE does nothing.
--
Summary: Missed pre opportunity
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rakdver at gcc dot gnu dot org
CC: dberlin at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23619