From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31112 invoked by alias); 24 Apr 2012 08:24:52 -0000 Received: (qmail 30981 invoked by uid 22791); 24 Apr 2012 08:24:45 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Apr 2012 08:24:32 +0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/33512] Simple bitwise simplification missed Date: Tue, 24 Apr 2012 08:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: missed-optimization, patch, TREE X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg02092.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33512 --- Comment #13 from Andrew Pinski 2012-04-24 08:19:59 UTC --- Patch which I am testing: Index: tree-ssa-forwprop.c =================================================================== --- tree-ssa-forwprop.c (revision 186755) +++ tree-ssa-forwprop.c (working copy) @@ -1913,10 +1913,10 @@ simplify_bitwise_binary (gimple_stmt_ite /* Simplify (A & B) OP0 (C & B) to (A OP0 C) & B. */ if (def1_code == def2_code && def1_code == BIT_AND_EXPR - && operand_equal_for_phi_arg_p (gimple_assign_rhs2 (def1), - gimple_assign_rhs2 (def2))) + && operand_equal_for_phi_arg_p (def1_arg2, + def2_arg2)) { - tree b = gimple_assign_rhs2 (def1); + tree b = def1_arg2; tree a = def1_arg1; tree c = def2_arg1; tree inner = fold_build2 (code, TREE_TYPE (arg2), a, c); --- CUT --- This was definitely my fault. I tested both patches independently and forgot to test them together. Sorry about that.