public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "steven at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/53804] branch reordering missed optimization
Date: Fri, 29 Jun 2012 10:43:00 -0000	[thread overview]
Message-ID: <bug-53804-4-SSK9qIwYnP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53804-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2012-06-29 10:43:19 UTC ---
On x86_64-unknown-linux-gnu, this case is optimized because the second branch
condition is combined for both foo1 and foo2:

<bb 3>:
  D.1723_4 = b_3(D) > 0;
  D.1724_5 = a_2(D) < 0;
  D.1725_6 = D.1724_5 & D.1723_4;
  if (D.1725_6 != 0)
    goto <bb 4>;
  else
    goto <bb 5>;

=>

foo1:
        testl   %edi, %edi
        movl    $1, %eax
        jle     .L9
        rep
        ret
.L9:
        shrl    $31, %edi
        testb   %dil, %dil
        jne     .L10
.L4:
        movl    $9, %eax
        ret
.L10:
        testl   %esi, %esi
        jle     .L4
        movl    $-3, %eax
        ret


foo2:
        testl   %edi, %edi
        movl    $1, %eax
        jle     .L18
        rep
        ret
.L18:
        shrl    $31, %edi
        testb   %dil, %dil
        jne     .L19
.L14:
        movl    $9, %eax
        ret
.L19:
        testl   %esi, %esi
        jle     .L14
        movl    $-3, %eax
        ret


  reply	other threads:[~2012-06-29 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29 10:36 [Bug tree-optimization/53804] New: " steven at gcc dot gnu.org
2012-06-29 10:43 ` steven at gcc dot gnu.org [this message]
2013-12-26 23:43 ` [Bug tree-optimization/53804] " steven at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53804-4-SSK9qIwYnP@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).