public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/52813] %rsp in clobber list is silently ignored
Date: Sun, 01 Apr 2012 18:58:00 -0000	[thread overview]
Message-ID: <bug-52813-4-blqoJna6Do@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52813-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2012-04-01 18:58:27 UTC ---
(In reply to comment #2)
> I don't expect the compiler to analyze the asm string.  I expect the compiler
> to respect my clobber list.
> 
> I told GCC that I would clobber %rsp.  Any other register that I put in the
> clobber list causes GCC to save that register to the stack or to another
> register before the asm and restore it from the stack/register after the asm. 
> For example:

%rsp is considered a "fixed" register, used for fixed purposes all throughout
the compiled code and are therefore not available for general allocation.

So, save %rsp at the beginning of your asm code and restore it at the end.


  parent reply	other threads:[~2012-04-01 18:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 22:53 [Bug inline-asm/52813] New: " jhaberman at gmail dot com
2012-04-01  9:21 ` [Bug inline-asm/52813] " ubizjak at gmail dot com
2012-04-01 15:54 ` jhaberman at gmail dot com
2012-04-01 18:58 ` ubizjak at gmail dot com [this message]
2012-04-01 19:23 ` jhaberman at gmail dot com
2012-05-28 23:10 ` ralph-gccbugzilla at inputplus dot co.uk

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-52813-4-blqoJna6Do@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).