[Bug tree-optimization/19828] [4.0 Regression] LIM is pulling out a pure function even though there is something which can modify global memory
drow at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Feb 9 06:27:00 GMT 2005
------- Additional Comments From drow at gcc dot gnu dot org 2005-02-08 19:27 -------
Here's another related testcase. If you uncomment the store to global_int,
LIM will move only func_const out of the loop. With them both commented
out, however, the pure call gets moved out of the loop. func_other may
modify global memory, though, so the pure call can not be moved.
int func_pure (void) __attribute__ ((pure));
int func_const (void) __attribute__ ((const));
void func_other (int);
int global_int;
int
func_loop (int arg)
{
while (arg--)
{
// global_int = arg;
func_other (func_pure ());
}
}
int
func_loop_2 (int arg)
{
while (arg--)
{
// global_int = arg;
func_other (func_const ());
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19828
More information about the Gcc-bugs
mailing list