gcc-bugs@gcc.gnu.org
[Top] [All Lists]

[Bug tree-optimization/23361] Can't eliminate empty loops with power of

Subject: [Bug tree-optimization/23361] Can't eliminate empty loops with power of two step and variable bounds
From: "chris at bubblescope dot net"
Date: 15 Sep 2005 14:02:10 -0000
------- Additional Comments From chris at bubblescope dot net  2005-09-15 14:02 
-------
Expanding slightly, I tried the following 4 functions. All were removed by 
-funsafe-loop-optimisations, 
but only foo3 was removed by -O3 without -funsafe-loop-optimisations. I can't 
see a good reason to 
remove foo3 but not remove foo4?

void foo(int a, int b)
{ for(;a!=b;a+=4); }


void foo2(int a, int b)
{ for(;a<b;a+=4); }

void foo3(int*a, int* b)
{ for(;a<b;a++); }

void foo4(int*a, int*b)
{ for(;a!=b;a++); }

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23361

<Prev in Thread] Current Thread [Next in Thread>