public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/35466]  New: Different assembly codes on 32bit and 64bit hosts
@ 2008-03-05  4:13 hjl dot tools at gmail dot com
  2008-03-05  4:28 ` [Bug target/35466] " hjl dot tools at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-03-05  4:13 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-09-17  9:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05  4:13 [Bug target/35466] New: Different assembly codes on 32bit and 64bit hosts hjl dot tools at gmail dot com
2008-03-05  4:28 ` [Bug target/35466] " hjl dot tools at gmail dot com
2008-03-05  7:40 ` steven at gcc dot gnu dot org
2008-03-05  7:50 ` pinskia at gcc dot gnu dot org
2008-03-06  9:44 ` rguenth at gcc dot gnu dot org
2008-03-06 13:33 ` jsm28 at gcc dot gnu dot org
2008-03-06 13:39 ` rguenth at gcc dot gnu dot org
2008-03-06 13:52 ` jsm28 at gcc dot gnu dot org
2009-04-07 16:52 ` info dot gnu at rt-labs dot com
2009-04-08  6:07 ` hp at gcc dot gnu dot org
2009-09-17  9:41 ` ubizjak at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).