This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35466] New: Different assembly codes on 32bit and 64bit hosts
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Mar 2008 04:13:06 -0000
- Subject: [Bug target/35466] New: Different assembly codes on 32bit and 64bit hosts
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Gcc generates different 32bit assembly codes in 32bit and 64bit hosts:
1. On 64bit host,
[hjl@gnu-26 stage1-gcc]$ cat x.i
_Decimal128 test (void)
{
return 1234123412341234.123412341234dl;
}
[hjl@gnu-26 stage1-gcc]$ ./xgcc -B./ -msse -S -m32 -march=i386 -mtune=generic
x.i
[hjl@gnu-26 stage1-gcc]$ cat x.s
.file "x.i"
.text
.globl test
.type test, @function
test:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movaps .LC0, %xmm0
movaps %xmm0, (%eax)
popl %ebp
ret $4
.size test, .-test
.section .rodata
.align 16
.LC0:
.long 84673010
.long 1025550150
.long 66901964
.long 807927808
.ident "GCC: (GNU) 4.4.0 20080304 (experimental) [trunk revision
132852]"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-26 stage1-gcc]$
2. On 32bit host,
[hjl@gnu-9 stage1-gcc]$ cat x.i
_Decimal128 test (void)
{
return 1234123412341234.123412341234dl;
}
[hjl@gnu-9 stage1-gcc]$ ./xgcc -B./ -msse -S -m32 -march=i386 -mtune=generic
x.i
[hjl@gnu-9 stage1-gcc]$ cat x.s
.file "x.i"
.text
.globl test
.type test, @function
test:
pushl %ebp
movl %esp, %ebp
subl $24, %esp
movl 8(%ebp), %eax
movaps .LC0, %xmm0
movaps %xmm0, -24(%ebp)
movaps -24(%ebp), %xmm0
movaps %xmm0, (%eax)
leave
ret $4
.size test, .-test
.section .rodata
.align 16
.LC0:
.long 84673010
.long 1025550150
.long 66901964
.long 807927808
.ident "GCC: (GNU) 4.4.0 20080304 (experimental) [trunk revision
132852]"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-9 stage1-gcc]$
Where does "subl $24, %esp" on 32bit host come from?
--
Summary: Different assembly codes on 32bit and 64bit hosts
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl dot tools at gmail dot com
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35466