aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-08 23:33:08 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-08 18:33:08 -0500
commit66c60e67562e57ace539e135207e099075b9ab39 (patch)
tree387766338bc3b88a17a6c4455af83343aa8dbd9d /gcc/expr.c
parent99a2782c86a5ee88f7dab3814094f5d638009079 (diff)
downloadgcc-66c60e67562e57ace539e135207e099075b9ab39.zip
gcc-66c60e67562e57ace539e135207e099075b9ab39.tar.gz
gcc-66c60e67562e57ace539e135207e099075b9ab39.tar.bz2
expr.c (emit_block_move): If X is readonly emit CLOBBER for it.
* expr.c (emit_block_move): If X is readonly emit CLOBBER for it. (clear_storage): Likewise, for OBJECT. From-SVN: r46865
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0cbd8fd..d5c1407 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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));
}
}