[Bug rtl-optimization/47521] Unnecessary usage of edx register

tony.poppleton at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Apr 10 01:51:00 GMT 2013


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

--- Comment #7 from Tony Poppleton <tony.poppleton at gmail dot com> 2013-04-10 01:51:36 UTC ---
This appears to be fixed with GCC 4.8.0 and flag -O2.  The asm code produced is
now exactly as Jeff said in comment #3:

        .file   "test.c"
        .text
        .p2align 4,,15
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        testb   $16, %dil
        movl    $1, %eax
        cmovne  %edi, %eax
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 4.8.0 20130316 (Red Hat 4.8.0-0.17)"
        .section        .note.GNU-stack,"",@progbits



More information about the Gcc-bugs mailing list