This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/22348] [4.0/4.1 Regression] IV canonicalization causes execution of loops past their end condition
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jul 2005 20:33:40 -0000
- Subject: [Bug tree-optimization/22348] [4.0/4.1 Regression] IV canonicalization causes execution of loops past their end condition
- References: <20050707165800.22348.matt+gccbugs@ucc.asn.au>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-07-14 20:33 -------
On mainline we have this .empty dump for main:
;; Function main (main)
main ()
{
unsigned int i;
int D.1613;
int i.0;
<bb 0>:
# i_2 = PHI <i_6(2), 4(0)>;
<L0>:;
i.0_5 = (int) i_2;
f (i.0_5);
i_6 = i_2 + 3;
if (i_6 <= 51) goto <L6>; else goto <L2>;
<L6>:;
goto <bb 1> (<L0>);
<L2>:;
return 0;
}
and this .ivcanon dump, which is wrong:
;; Function main (main)
main ()
{
unsigned int ivtmp.51;
unsigned int i;
int D.1613;
int i.0;
<bb 0>:
# ivtmp.51_1 = PHI <ivtmp.51_3(2), 1431655782(0)>;
# i_2 = PHI <i_6(2), 4(0)>;
<L0>:;
i.0_5 = (int) i_2;
f (i.0_5);
i_6 = i_2 + 3;
ivtmp.51_3 = ivtmp.51_1 - 1;
if (ivtmp.51_3 != 0) goto <L6>; else goto <L2>;
<L6>:;
goto <bb 1> (<L0>);
<L2>:;
return 0;
}
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rakdver at gcc dot gnu dot
| |org
Priority|P2 |P1
Summary|[4.0/4.1 Regression] |[4.0/4.1 Regression] IV
|Execution continues past end|canonicalization causes
|of for loop end condition |execution of loops past
|with optimisation enabled |their end condition
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22348