This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/26763] [4.1 Regression] wrong final value of induction variable calculated
- 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: 27 Mar 2006 22:33:11 -0000
- Subject: [Bug tree-optimization/26763] [4.1 Regression] wrong final value of induction variable calculated
- References: <bug-26763-5724@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rakdver at gcc dot gnu dot org 2006-03-27 22:33 -------
(gdb) call debug_generic_stmt (ret)
startD.1278_2 + -3B > startD.1278_2 + 396B;
(gdb) call debug_generic_stmt (fold (ret))
1
I guess the reasoning of fold is: it is pointer arithmetics, so it
does not wrap. (-3B) = (0xfff...7) > 396B, so the result is always true.
4.0 does not have final value replacement, and 4.2 has different # of
iterations analysis; but most likely some similar problem is latent in both
versions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763