diff mbox series

[committed,PR,rtl/90275] Complete recent change

Message ID 9d2d2bfa3d7b7a804462a8e3747ff46ef980a60a.camel@redhat.com
State New
Headers show
Series [committed,PR,rtl/90275] Complete recent change | expand

Commit Message

Jeff Law via Gcc-patches March 18, 2020, 10:09 p.m. UTC
So I must have botched this when I hand-applied Richard's patch and use that to
generate a new one (I went back to his original and verified he got it right).

We had a test like 

  && MEM_P (whatever) 

ANd wanted to include regs  ie

  && (MEM_P (whatever) || REG_P (whatever))

I added the latter, but didn't remove the former.  As a result the testcase still

This applies the obvious bit to remove the && MEM_P (whatever) line.

You could legitimately ask why the tester didn't flag the failure.  The tester
only looks for regressions.  A new test that fails is ignored.  I'd like to
change that one day, but for now that's where we are to avoid excessive noise.

Anyway, I put the attached patch into my tester last week.  And:


Tests that now work, but didn't before (1 tests):

gcc.c-torture/compile/pr90275.c   -O3 -g  (test for excess errors)

Committing to the trunk as obvious.

commit 529ea7d9596b26ba103578eeab448e9862a2d2c5
Author: Jeff Law <law@redhat.com>
Date:   Wed Mar 18 16:07:28 2020 -0600

    Complete change to resolve pr90275.
            PR rtl-optimization/90275
            * cse.c (cse_insn): Delete no-op register moves too.
diff mbox series


diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8694f272a9c..3a2e491113e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2020-03-12  Richard Sandiford  <richard.sandiford@arm.com>
+	PR rtl-optimization/90275
+	* cse.c (cse_insn): Delete no-op register moves too.
 2020-03-18  Martin Sebor  <msebor@redhat.com>
 	PR ipa/92799
diff --git a/gcc/cse.c b/gcc/cse.c
index 08984c17040..3e8724b3fed 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5329,7 +5329,6 @@  cse_insn (rtx_insn *insn)
 	  else if (n_sets == 1
 		   && !CALL_P (insn)
 		   && (MEM_P (trial) || REG_P (trial))
-		   && MEM_P (dest)
 		   && rtx_equal_p (trial, dest)
 		   && !side_effects_p (dest)
 		   && (cfun->can_delete_dead_exceptions