[Bug target/52838] New: [x32] missed optimization for pointer return value

bartoldeman at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Mon Apr 2 23:33:00 GMT 2012


             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)

when compiled with
gcc-4.7 -mx32 -Os -S test.c
    .file    "test.c"
    .globl    test
    .type    test, @function
    pushq    %rax
    .cfi_def_cfa_offset 16
    call    foo
    popq    %rdx
    .cfi_def_cfa_offset 8
    movq    %rax, %rdi
    jmp    bar
    .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.

More information about the Gcc-bugs mailing list