* expr.c (emit_block_move): If X is readonly emit CLOBBER for it.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Nov 2001 23:33:08 +0000 (23:33 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Nov 2001 23:33:08 +0000 (23:33 +0000)
(clear_storage): Likewise, for OBJECT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46865 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index 69199a7..a718a8f 100644 (file)
@@ -1,3 +1,8 @@
+Thu Nov  8 18:00:55 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * expr.c (emit_block_move): If X is readonly emit CLOBBER for it.
+       (clear_storage): Likewise, for OBJECT.
+
 Thu Nov  8 16:23:51 2001  Jeffrey A Law  (law@cygnus.com)
 
        * pa.c (emit_move_sequence): Fix SUBREG expression to
index 0cbd8fd..d5c1407 100644 (file)
@@ -1812,6 +1812,12 @@ emit_block_move (x, y, size)
                                          TREE_UNSIGNED (integer_type_node)),
                         TYPE_MODE (integer_type_node));
 #endif
+
+      /* If we are initializing a readonly value, show the above call
+        clobbered it.  Otherwise, a load from it may erroneously be hoisted
+        from a loop.  */
+      if (RTX_UNCHANGING_P (x))
+       emit_insn (gen_rtx_CLOBBER (VOIDmode, x));
     }
 
   return retval;
@@ -2717,6 +2723,12 @@ clear_storage (object, size)
                             VOIDmode, 2, object, Pmode, size,
                             TYPE_MODE (integer_type_node));
 #endif
+
+         /* If we are initializing a readonly value, show the above call
+            clobbered it.  Otherwise, a load from it may erroneously be
+            hoisted from a loop.  */
+         if (RTX_UNCHANGING_P (object))
+           emit_insn (gen_rtx_CLOBBER (VOIDmode, object));
        }
     }