public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/50603] New: [x32] Unnecessary lea
@ 2011-10-03 17:33 hjl.tools at gmail dot com
  2011-10-03 19:13 ` [Bug target/50603] " ubizjak at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-10-03 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50603
           Summary: [x32] Unnecessary lea
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: ubizjak@gmail.com


[hjl@gnu-6 ilp32-2]$ cat int.c
extern int *foo;

int bar (int x) { return foo[x]; }
[hjl@gnu-6 ilp32-2]$ make int.s
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -S -mx32  -O2 int.c
[hjl@gnu-6 ilp32-2]$ cat int.s
    .file    "int.c"
    .text
    .p2align 4,,15
    .globl    bar
    .type    bar, @function
bar:
.LFB0:
    .cfi_startproc
    movl    foo(%rip), %eax
    leal    (%rax,%rdi,4), %edi
    movl    (%edi), %eax
    ret
    .cfi_endproc
.LFE0:
    .size    bar, .-bar
    .ident    "GCC: (GNU) 4.7.0 20110923 (experimental)"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-6 ilp32-2]$ 

We can generate

    movl    foo(%rip), %eax
    movl    (%eax,%edi,4), %eax
        ret


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

end of thread, other threads:[~2011-10-09  9:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 17:33 [Bug target/50603] New: [x32] Unnecessary lea hjl.tools at gmail dot com
2011-10-03 19:13 ` [Bug target/50603] " ubizjak at gmail dot com
2011-10-03 20:58 ` hjl.tools at gmail dot com
2011-10-06 19:01 ` hjl.tools at gmail dot com
2011-10-06 19:19 ` hjl.tools at gmail dot com
2011-10-06 19:38 ` hjl.tools at gmail dot com
2011-10-06 19:44 ` hjl.tools at gmail dot com
2011-10-07  6:43 ` uros at gcc dot gnu.org
2011-10-09  9:30 ` 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).