Patchwork Simplify code in gimple_equal_p

login
register
mail settings
Submitter Tom de Vries
Date Nov. 9, 2013, 3:30 p.m.
Message ID <527E550D.2010107@xs4all.nl>
Download mbox | patch
Permalink /patch/289996/
State New
Headers show

Comments

Tom de Vries - Nov. 9, 2013, 3:30 p.m.
Richard,

This patch simplifies code in gimple_equal_p.

Bootstrapped and regtested on x86_64.

OK for trunk?

Thanks,
- Tom

2013-11-06  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-tail-merge.c (gimple_equal_p): Remove equal variable.
Richard Guenther - Nov. 11, 2013, 9:33 a.m.
On Sat, 9 Nov 2013, Tom de Vries wrote:

> Richard,
> 
> This patch simplifies code in gimple_equal_p.
> 
> Bootstrapped and regtested on x86_64.
> 
> OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> - Tom
> 
> 2013-11-06  Tom de Vries  <tom@codesourcery.com>
> 
> 	* tree-ssa-tail-merge.c (gimple_equal_p): Remove equal variable.

Patch

diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index db95ce1..00dd071 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -1085,7 +1085,7 @@  gimple_equal_p (same_succ same_succ, gimple s1, gimple s2)
   tree lhs1, lhs2;
   basic_block bb1 = gimple_bb (s1), bb2 = gimple_bb (s2);
   tree t1, t2;
-  bool equal, inv_cond;
+  bool inv_cond;
   enum tree_code code1, code2;
 
   if (gimple_code (s1) != gimple_code (s2))
@@ -1107,7 +1107,6 @@  gimple_equal_p (same_succ same_succ, gimple s1, gimple s2)
       if (gimple_call_builtin_p (s1, BUILT_IN_TM_COMMIT))
 	return false;
 
-      equal = true;
       for (i = 0; i < gimple_call_num_args (s1); ++i)
 	{
 	  t1 = gimple_call_arg (s1, i);
@@ -1116,11 +1115,8 @@  gimple_equal_p (same_succ same_succ, gimple s1, gimple s2)
 	    continue;
 	  if (gvn_uses_equal (t1, t2))
 	    continue;
-	  equal = false;
-	  break;
+	  return false;
 	}
-      if (!equal)
-	return false;
 
       lhs1 = gimple_get_lhs (s1);
       lhs2 = gimple_get_lhs (s2);