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



--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-22 
14:24:14 UTC ---

(In reply to comment #3)

> (In reply to comment #1)

> > because it appears that 'save' makes all variables global ones.  

> 

> But this is maybe a frontend issue ? The visibility of x is local to the this

> subroutine, but its lifetime extends over the entire run (so different to your

> variable z in the C testcase).



No, same for



int x[1024], y[1024];

void foo (void)

{

  static int z;

  unsigned i;

  for (i = 0; i < 1024; ++i)

    {

      z = x[i] - y[i];

      x[i] = z;

    }

}



(missed optimization is that the variable and the store to it is not

removed completely).

Reply via email to