This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/19001] [3.4/4.0 Regression] Loops with power of two step and variable bounds not unrolled
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2004 12:28:02 -0000
- Subject: [Bug rtl-optimization/19001] [3.4/4.0 Regression] Loops with power of two step and variable bounds not unrolled
- References: <20041215002551.19001.rakdver@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From chris at bubblescope dot net 2004-12-15 12:28 -------
Also (stating the perhaps blindingly obvious), this bug is not being caused by
the fact that the loop contains a return statement.
int check(int* a,int *b)
{
int* returnval=b;
for(;a<b;++a)
if(*a) returnval=a;
return returnval;
}
Also is not optimised.
Out of interest, surely when the loop actually involves pointers, then "looping
a pointer around the end of memory" is undefined behaviour, and therefore this
doesn't have to be considered in terms of optimising (although this won't help
the case in the original bug report).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19001