public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/65474] New: sub-optimal code for __builtin_abs
@ 2015-03-19 19:21 wmi at google dot com
  2015-03-19 22:53 ` [Bug target/65474] " wmi at google dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wmi at google dot com @ 2015-03-19 19:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65474

            Bug ID: 65474
           Summary: sub-optimal code for __builtin_abs
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wmi at google dot com

int foo(int x) {
  return __builtin_abs(x);
}

~/workarea/gcc-r221398/build/install/bin/gcc -O2 -S 1.c -o 1.gcc.s
        .cfi_startproc
        movl    %edi, %edx
        movl    %edi, %eax
        sarl    $31, %edx
        xorl    %edx, %eax
        subl    %edx, %eax
        ret
        .cfi_endproc

~/workarea/llvm-r224097/build/bin/clang -O2 -S 1.c -o 1.llvm.s
        .cfi_startproc
        movl    %edi, %eax
        negl    %eax
        cmovll  %edi, %eax
        retq
        .cfi_endproc


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

end of thread, other threads:[~2015-03-20 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19 19:21 [Bug middle-end/65474] New: sub-optimal code for __builtin_abs wmi at google dot com
2015-03-19 22:53 ` [Bug target/65474] " wmi at google dot com
2015-03-19 22:54 ` wmi at google dot com
2015-03-20 10:59 ` rguenth 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).