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]

[rl78] avoid move-elim on volatile mems


See $subj.  Committed.

	* config/rl78/rl78.c (move_elim_pass): Don't optimize away
	volatile memory references.

Index: config/rl78/rl78.c
===================================================================
--- config/rl78/rl78.c	(revision 220150)
+++ config/rl78/rl78.c	(working copy)
@@ -222,7 +222,12 @@
 	 can eliminate the second SET.  */
       if (prev
 	  && rtx_equal_p (SET_DEST (prev), SET_SRC (set))
-	  && rtx_equal_p (SET_DEST (set), SET_SRC (prev)))
+	  && rtx_equal_p (SET_DEST (set), SET_SRC (prev))
+	  /* ... and none of the operands are volatile.  */
+	  && ! volatile_refs_p (SET_SRC (prev))
+	  && ! volatile_refs_p (SET_DEST (prev))
+	  && ! volatile_refs_p (SET_SRC (set))
+	  && ! volatile_refs_p (SET_DEST (set)))
 	{
 	  if (dump_file)
 	    fprintf (dump_file, " Delete insn %d because it is redundant\n",


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