diff mbox series

fix reassoc cut&pasto

Message ID ord0uklwq2.fsf@lxoliva.fsfla.org
State New
Headers show
Series fix reassoc cut&pasto | expand

Commit Message

Alexandre Oliva Aug. 14, 2018, 4:49 p.m. UTC
I guess this was a cut&pasto.  I caught it during code review.  It
doesn't seem to matter much: I haven't been able to get any codegen
difference from this change, not in a bootstrap, not in test runs.  I
even put a gcc_unreachable() in case the test on rhs2 were to return
false (which would never happen after the test on rhs1 passed, when rhs1
and rhs2 were the same), and still no hits in stage3.  Anyway...

Regstrapped on x86_64-linux-gnu.  Ok to install?

From: Alexandre Oliva <aoliva@redhat.com>

for  gcc/ChangeLog

	* tree-ssa-reassoc.c (is_reassociable_op): Fix cut&pasto.
---
 gcc/tree-ssa-reassoc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Law Aug. 15, 2018, 4:15 a.m. UTC | #1
On 08/14/2018 10:49 AM, Alexandre Oliva wrote:
> I guess this was a cut&pasto.  I caught it during code review.  It
> doesn't seem to matter much: I haven't been able to get any codegen
> difference from this change, not in a bootstrap, not in test runs.  I
> even put a gcc_unreachable() in case the test on rhs2 were to return
> false (which would never happen after the test on rhs1 passed, when rhs1
> and rhs2 were the same), and still no hits in stage3.  Anyway...
> 
> Regstrapped on x86_64-linux-gnu.  Ok to install?
> 
> From: Alexandre Oliva <aoliva@redhat.com>
> 
> for  gcc/ChangeLog
> 
> 	* tree-ssa-reassoc.c (is_reassociable_op): Fix cut&pasto.
OK.
jeff
diff mbox series

Patch

diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 41a37ab29899..6b0bf5c03548 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -618,7 +618,7 @@  is_reassociable_op (gimple *stmt, enum tree_code code, struct loop *loop)
       && has_single_use (gimple_assign_lhs (stmt)))
     {
       tree rhs1 = gimple_assign_rhs1 (stmt);
-      tree rhs2 = gimple_assign_rhs1 (stmt);
+      tree rhs2 = gimple_assign_rhs2 (stmt);
       if (TREE_CODE (rhs1) == SSA_NAME
 	  && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs1))
 	return false;