public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/51491] ccp when converting from alloca should add a CLOBBER to right before __builtin_stack_restore
Date: Mon, 12 Dec 2011 21:43:00 -0000	[thread overview]
Message-ID: <bug-51491-4-O0jbaspFiq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51491-4@http.gcc.gnu.org/bugzilla/>

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
...


  parent reply	other threads:[~2011-12-12 21:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10  0:47 [Bug tree-optimization/51491] New: " pinskia at gcc dot gnu.org
2011-12-12 10:38 ` [Bug tree-optimization/51491] " rguenth at gcc dot gnu.org
2011-12-12 13:14 ` vries at gcc dot gnu.org
2011-12-12 20:14 ` pinskia at gcc dot gnu.org
2011-12-12 21:33 ` vries at gcc dot gnu.org
2011-12-12 21:43 ` vries at gcc dot gnu.org [this message]
2011-12-12 22:24 ` jakub at gcc dot gnu.org
2011-12-13 15:02 ` vries at gcc dot gnu.org
2011-12-17 11:41 ` vries at gcc dot gnu.org
2011-12-17 11:43 ` vries at gcc dot gnu.org
2011-12-17 12:50 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-51491-4-O0jbaspFiq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).