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 inline-asm/43112] New: 'A' constraint's behavior not compliant with doc under x86-64


According to "info gcc", the 'A' constraint denotes the `a' and `d'
registers, as a pair (for instructions that return half the result in
one and half in the other). However, in reality 'A' is treated simply as
a 64-bit long integer in %rax under x86-64. For example, the following
code piece:

#include <stdint.h>

uint64_t rdtsc(void)
{
        uint64_t ret;
        asm ("rdtsc":"=A"(ret));
        return ret;
}

produces:

[zuxy@Rainbow31 bin]$ objdump -d a.o

a.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <rdtsc>:
   0:   0f 31                   rdtsc
   2:   c3                      retq


-- 
           Summary: 'A' constraint's behavior not compliant with doc under
                    x86-64
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zuxy dot meng at gmail dot com
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


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


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