public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "thutt at vmware dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/16331] x86-64 inline asm register constraints insufficient WRT ABI
Date: Fri, 02 Jul 2004 18:49:00 -0000	[thread overview]
Message-ID: <20040702184903.15565.qmail@sourceware.org> (raw)
In-Reply-To: <20040702165134.16331.thutt@vmware.com>


------- Additional Comments From thutt at vmware dot com  2004-07-02 18:49 -------
This is only guaranteed to work for global variables.  From the gcc info pages:

Variables in Specified Registers
================================

   GNU C allows you to put a few global variables into specified
hardware registers.  You can also specify the register in which an
ordinary register variable should be allocated.

   * Global register variables reserve registers throughout the program.
     This may be useful in programs such as programming language
     interpreters which have a couple of global variables that are
     accessed very often.

   * Local register variables in specific registers do not reserve the
     registers.  The compiler's data flow analysis is capable of
     determining where the specified registers contain live values, and
     where they are available for other uses.  Stores into local
     register variables may be deleted when they appear to be dead
     according to dataflow analysis.  References to local register
     variables may be deleted or moved or simplified.

     These local variables are sometimes convenient for use with the
     extended `asm' feature (*note Extended Asm::.), if you want to
     write one output of the assembler instruction directly into a
     particular register.  (This will work provided the register you
     specify fits the constraints specified for that operand in the
     `asm'.)

I read this to say that the compiler may, or may not, actually use the suggested
register.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


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


  parent reply	other threads:[~2004-07-02 18:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-02 16:51 [Bug c/16331] New: " thutt at vmware dot com
2004-07-02 16:57 ` [Bug c/16331] " falk at debian dot org
2004-07-02 18:49 ` thutt at vmware dot com [this message]
2004-07-02 18:54 ` pinskia at gcc dot gnu dot org
2004-07-06 14:55 ` thutt at vmware dot com
2004-08-03  7:06 ` [Bug target/16331] " pinskia at gcc dot gnu dot org
2005-07-02  1:27 ` pinskia at gcc dot gnu dot org
2005-07-02 10:17 ` falk at debian dot org
2005-09-04 19:05 ` pinskia at gcc dot gnu dot 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=20040702184903.15565.qmail@sourceware.org \
    --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).