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 #5 from vries at gcc dot gnu.org 2011-12-12 21:33:03 UTC ---
Created attachment 26061
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26061
tentative patch

Using this tentative patch, now also f in f.c.149t.optimized  has 2 clobbers:
...
f ()
{
  <unnamed-unsigned:8> D.1726[16];
  int a[4];
  int tt;
  int D.1722;
  int D.1721;
  void * saved_stack.2;
  int D.1719;

<bb 2>:
  saved_stack.2_3 = __builtin_stack_save ();
  tt_18 = g (&D.1726);
  D.1719_19 = MEM[(int[0:D.1713] *)&D.1726][0];
  tt_20 = D.1719_19 + tt_18;
  D.1726 ={v} {CLOBBER};
  __builtin_stack_restore (saved_stack.2_3);
  D.1721_21 = g (&a);
  tt_22 = D.1721_21 + tt_20;
  D.1722_23 = a[0];
  tt_24 = D.1722_23 + tt_22;
  a ={v} {CLOBBER};
  return tt_24;

}
...

and f only uses 16 bytes stack space:
...
$ grep 'subq.*rsp' f1.s f.
f1.s:    subq    $16, %rsp
f.s:    subq    $16, %rsp
...


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