This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/33512] Simple bitwise simplification missed
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Apr 2012 08:19:59 +0000
- Subject: [Bug tree-optimization/33512] Simple bitwise simplification missed
- Auto-submitted: auto-generated
- References: <bug-33512-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33512
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> 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.