From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15573 invoked by alias); 2 Jul 2004 18:49:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 15566 invoked by uid 48); 2 Jul 2004 18:49:03 -0000 Date: Fri, 02 Jul 2004 18:49:00 -0000 Message-ID: <20040702184903.15565.qmail@sourceware.org> From: "thutt at vmware dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040702165134.16331.thutt@vmware.com> References: <20040702165134.16331.thutt@vmware.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/16331] x86-64 inline asm register constraints insufficient WRT ABI X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg00157.txt.bz2 List-Id: ------- 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