public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/46909] [4.6 Regression] Logical OR expressions are miscompiled
Date: Mon, 13 Dec 2010 13:02:00 -0000	[thread overview]
Message-ID: <bug-46909-4-j4uxuqeFju@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46909-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-13 13:02:22 UTC ---
The fix is easy:
@@ -2441,7 +2441,7 @@ or_var_with_comparison_1 (gimple stmt,
          => (t OR inner2)
          If the partial result t is a constant, we win.  Otherwise
          continue on to try reassociating with the other inner test.  */
-      if (innercode == TRUTH_OR_EXPR)
+      if (is_or)
         {
           if (integer_onep (t))
         return boolean_true_node;
@@ -2474,7 +2474,7 @@ or_var_with_comparison_1 (gimple stmt,
       /* Handle the OR case, where we are reassociating:
          (inner1 OR inner2) OR (op2a code2 op2b)
          => (inner1 OR t)  */
-      if (innercode == TRUTH_OR_EXPR)
+      if (is_or)
         {
           if (integer_zerop (t))
         return inner1;

(the and folder does it that way correctly).  Still looking why it isn't
optimized now into x != 4.


  parent reply	other threads:[~2010-12-13 13:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 16:28 [Bug middle-end/46909] New: [4.6 Regression] elf32-i386.c and elf64-x86-64.c in binutils " hjl.tools at gmail dot com
2010-12-12 17:44 ` [Bug middle-end/46909] " hjl.tools at gmail dot com
2010-12-12 18:12 ` hjl.tools at gmail dot com
2010-12-12 19:22 ` hjl.tools at gmail dot com
2010-12-12 19:27 ` hjl.tools at gmail dot com
2010-12-12 19:30 ` jakub at gcc dot gnu.org
2010-12-12 21:29 ` [Bug middle-end/46909] [4.6 Regression] Logical OR expressions " hjl.tools at gmail dot com
2010-12-13 13:02 ` jakub at gcc dot gnu.org [this message]
2010-12-13 14:22 ` [Bug tree-optimization/46909] " jakub at gcc dot gnu.org
2010-12-14 14:10 ` jakub at gcc dot gnu.org
2010-12-14 14:32 ` jakub 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-46909-4-j4uxuqeFju@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).