http://sourceware.org/bugzilla/show_bug.cgi?id=15034

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2013-01-25 18:34:29 
UTC ---
(In reply to comment #1)
> Also I found, that reading long (64 bit) data with intel syntax is OK 
> *(volatile long*)0xFEE00000; 
> while reading any other data types will issue an error.

It is a bug in GCC:

[hjl@gnu-6 tmp]$ cat l.c
long
foo2 (void)
{
  return *(volatile long*)0xFEE00000;
}
[hjl@gnu-6 tmp]$ gcc -c l.c -O2 -masm=intel
[hjl@gnu-6 tmp]$ objdump -dw l.o

l.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo2>:
   0:    48 b8 00 00 e0 fe 00 00 00 00     movabs $0xfee00000,%rax
   a:    c3                       retq   
[hjl@gnu-6 tmp]$ gcc -c l.c -O2 
[hjl@gnu-6 tmp]$ objdump -dw l.o

l.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo2>:
   0:    48 a1 00 00 e0 fe 00 00 00 00     movabs 0xfee00000,%rax
   a:    c3                       retq   
[hjl@gnu-6 tmp]$ 

movabs should only be used for loading an 64-bit immediate or
loading from an absolute address.

movabs  rax,0xfee00000

loads 0xfee00000 into RAX.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to