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 middle-end/55145] Different bits for long double constant depending ptr_mode


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |middle-end
            Summary|[4.8 Regression] [x32]      |Different bits for long
                   |-maddress-mode=long         |double constant depending
                   |miscompiles glibc           |ptr_mode

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-04 08:11:01 UTC ---
GCC i386 and GCC x86-64 generate different bits long double constant
depending ptr_mode:

[hjl@gnu-tools-1 tmp]$ cat y.c
const long double
 pio2_hi = 1.5707963267948966192021943710788178805159986950457096099853515625L;
[hjl@gnu-tools-1 tmp]$ /usr/gcc-4.7.3-32bit/bin/gcc -S y.c -o 32.s
[hjl@gnu-tools-1 tmp]$ gcc -S y.c -o 64.s
[hjl@gnu-tools-1 tmp]$ diff -up 64.s 32.s
--- 64.s    2012-11-04 01:06:52.492398183 -0700
+++ 32.s    2012-11-04 01:06:47.685344002 -0700
@@ -3,11 +3,10 @@
     .section    .rodata
     .align 16
     .type    pio2_hi, @object
-    .size    pio2_hi, 16
+    .size    pio2_hi, 12
 pio2_hi:
-    .long    560513588
-    .long    3373259426
+    .long    560513589
+    .long    -921707870
     .long    16383
-    .long    0
-    .ident    "GCC: (GNU) 4.7.2 20120921 (Red Hat 4.7.2-2)"
+    .ident    "GCC: (GNU) 4.7.3 20121024 (prerelease)"
     .section    .note.GNU-stack,"",@progbits
[hjl@gnu-tools-1 tmp]$ gcc -c 32.s 64.s
[hjl@gnu-tools-1 tmp]$ objdump -s -j .rodata 32.o > 32
[hjl@gnu-tools-1 tmp]$ objdump -s -j .rodata 64.o > 64
[hjl@gnu-tools-1 tmp]$ diff -up 32 64
--- 32    2012-11-04 01:07:37.341913094 -0700
+++ 64    2012-11-04 01:07:42.192979572 -0700
@@ -1,5 +1,5 @@

-32.o:     file format elf64-x86-64
+64.o:     file format elf64-x86-64

 Contents of section .rodata:
- 0000 35c26821 a2da0fc9 ff3f0000           5.h!.....?..    
+ 0000 34c26821 a2da0fc9 ff3f0000 00000000  4.h!.....?......
[hjl@gnu-tools-1 tmp]$ 

Ignore padding, i386 GCC generates 35c26821 and
x86-64 generates 34c26821.


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