public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52838] New: [x32] missed optimization for pointer return value
@ 2012-04-02 23:33 bartoldeman at users dot sourceforge.net
  2012-04-04 19:07 ` [Bug rtl-optimization/52838] " ubizjak at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bartoldeman at users dot sourceforge.net @ 2012-04-02 23:33 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52838
           Summary: [x32] missed optimization for pointer return value
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bartoldeman@users.sourceforge.net


The program test.c:

extern void *foo(void);
extern void bar(void*);

void test(void)
{
  bar(foo());
}

when compiled with
gcc-4.7 -mx32 -Os -S test.c
produces:
    .file    "test.c"
    .text
    .globl    test
    .type    test, @function
test:
.LFB0:
    .cfi_startproc
    pushq    %rax
    .cfi_def_cfa_offset 16
    call    foo
    popq    %rdx
    .cfi_def_cfa_offset 8
    movq    %rax, %rdi
    jmp    bar
    .cfi_endproc
.LFE0:
    .size    test, .-test
    .ident    "GCC: (Debian 4.7.0-1) 4.7.0"
    .section    .note.GNU-stack,"",@progbits

Here "movq %rax, %rdi" could be replaced by "movl %eax, %edi", saving one
prefix byte 0x48.


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

end of thread, other threads:[~2021-08-30  2:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 23:33 [Bug target/52838] New: [x32] missed optimization for pointer return value bartoldeman at users dot sourceforge.net
2012-04-04 19:07 ` [Bug rtl-optimization/52838] " ubizjak at gmail dot com
2012-04-04 21:41 ` ebotcazou at gcc dot gnu.org
2012-04-05  0:46 ` hjl.tools at gmail dot com
2012-04-05 12:37 ` ubizjak at gmail dot com
2012-04-05 16:17 ` ebotcazou at gcc dot gnu.org
2021-08-30  2:08 ` [Bug target/52838] " pinskia at gcc dot gnu.org

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).