This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/26629] New: tree load PRE does not work on array references
- 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: 10 Mar 2006 05:31:08 -0000
- Subject: [Bug tree-optimization/26629] New: tree load PRE does not work on array references
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
While Looking into PR 21485, I noticed this. This might come up more with the
array references for pointers patch.
Testcase:
typedef long dtype;
typedef dtype longarray[];
int g (longarray *array1, unsigned long i, dtype j)
{
if ((*array1)[i] < (*array1)[i + 1])
++i;
if (j < (*array1)[i])
h();
return i;
}
int g2 (longarray *array1, unsigned long i, dtype j)
{
dtype a = (*array1)[i];
dtype b = (*array1)[i + 1];
dtype c = a;
if (a < b) ++i, c = b;
if (j < c)
h();
return i;
}
g2 is the optimized version of g. If I remove the "return i", the RTL level
optimizations catches it.
--
Summary: tree load PRE does not work on array references
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26629