This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26898] New: Fold does not fold signed +- CST CMP signed +- CST
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2006 13:49:12 -0000
- Subject: [Bug middle-end/26898] New: Fold does not fold signed +- CST CMP signed +- CST
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Fold at the moment does not fold comparisons involving signed variables with
a constant offset. Like we get from number-of-iterations analysis for
int foo0(int i0, int i1)
{
int i, j = 0;
for (i=i0; i<=i1+1; ++i)
++j;
return j;
}
where niter->may_be_zero ends up as i0 + 1 < i1 + 2 which can be folded
to i0 < i1 + 1 because signed overflow is undefined.
And I have a patch for this.
--
Summary: Fold does not fold signed +- CST CMP signed +- CST
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26898