This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/51491] ccp when converting from alloca should add a CLOBBER to right before __builtin_stack_restore


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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-12 19:51:32 UTC ---
The testcase which I referenced in the bug report is one where it shows adding
a CLOBBER is a good idea.  Anyways the following two functions should produce
the same exact code:
int g(int*);

int f(void)
{
  int tt = 0;
  int t = 4;
  {
    int a[t];
    tt = g(a);
    tt += a[0];
  }
  {
    int a[4];
    tt += g(a);
    tt += a[0];
  }
  return tt;
}
int f1(void)
{
  int tt = 0;
  int t = 4;
  {
    int a[4];
    tt = g(a);
    tt += a[0];
  }
  {
    int a[4];
    tt += g(a);
    tt += a[0];
  }
  return tt;
}
--- CUT ---
Currently without adding the CLOBBER, f's stack size is much bigger than f1's.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]