[Bug rtl-optimization/19001] [3.4/4.0 Regression] Loops with power of two step and variable bounds not unrolled

chris at bubblescope dot net gcc-bugzilla@gcc.gnu.org
Wed Dec 15 12:28:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list