This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Delete moves that are turned into no-ops by reload_cse


As well as doing CSE, reload_cse has code to delete no-op moves.
What's slightly odd is that this code is skipped for moves that
were simplified by CSE itself.

This patch fixes that.  I checked that postreload now removes the
no-op that Steven described here:

    http://gcc.gnu.org/ml/gcc/2006-02/msg00650.html

Bootstrapped & regression-tested on i686-pc-linux-gnu.  OK to install?

Richard


	* postreload.c (reload_cse_simplify): Delete moves that are turned
	into no-ops by CSE.

Index: gcc/postreload.c
===================================================================
--- gcc/postreload.c	(revision 111473)
+++ gcc/postreload.c	(working copy)
@@ -99,12 +99,13 @@ reload_cse_simplify (rtx insn, rtx testr
          this out, so it's safer to simplify before we delete.  */
       count += reload_cse_simplify_set (body, insn);
 
-      if (!count && reload_cse_noop_set_p (body))
+      if (reload_cse_noop_set_p (body))
 	{
 	  rtx value = SET_DEST (body);
 	  if (REG_P (value)
 	      && ! REG_FUNCTION_VALUE_P (value))
 	    value = 0;
+	  cancel_changes (0);
 	  delete_insn_and_edges (insn);
 	  return;
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]