From: H.J. Lu Date: Tue, 10 May 2005 21:53:06 +0000 (+0000) Subject: backport: function.c (fixup_var_refs): Save volatile_ok and set to 1. X-Git-Tag: releases/gcc-3.4.4~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c22fcc75e9f4634aa41e9af17173750524ec6415;p=thirdparty%2Fgcc.git backport: function.c (fixup_var_refs): Save volatile_ok and set to 1. Backport from mainline 2004-02-12 Richard Kenner * function.c (fixup_var_refs): Save volatile_ok and set to 1. * expr.c (emit_block_move_via_movstr): Save and restore volatile_ok. From-SVN: r99543 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 77de6eb79f60..360fe4cc3322 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2005-05-10 H.J. Lu + + Backport from mainline + 2004-02-12 Richard Kenner + * function.c (fixup_var_refs): Save volatile_ok and set to 1. + * expr.c (emit_block_move_via_movstr): Save and restore + volatile_ok. + 2005-05-10 Jakub Jelinek * config/i386/i386.md (sse_mov?fcc* splitters): Add mode to diff --git a/gcc/expr.c b/gcc/expr.c index fcb5b0c78d68..1ce2fa4b793c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -1452,6 +1452,7 @@ static bool emit_block_move_via_movstr (rtx x, rtx y, rtx size, unsigned int align) { rtx opalign = GEN_INT (align / BITS_PER_UNIT); + int save_volatile_ok = volatile_ok; enum machine_mode mode; /* Since this is a move insn, we don't care about volatility. */ @@ -1501,7 +1502,7 @@ emit_block_move_via_movstr (rtx x, rtx y, rtx size, unsigned int align) if (pat) { emit_insn (pat); - volatile_ok = 0; + volatile_ok = save_volatile_ok; return true; } else @@ -1509,7 +1510,7 @@ emit_block_move_via_movstr (rtx x, rtx y, rtx size, unsigned int align) } } - volatile_ok = 0; + volatile_ok = save_volatile_ok; return false; } diff --git a/gcc/function.c b/gcc/function.c index 087467cc0cdd..206b11ddddee 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1517,6 +1517,7 @@ fixup_var_refs (rtx var, enum machine_mode promoted_mode, int unsignedp, rtx first_insn = get_insns (); struct sequence_stack *stack = seq_stack; tree rtl_exps = rtl_expr_chain; + int save_volatile_ok = volatile_ok; /* If there's a hash table, it must record all uses of VAR. */ if (ht) @@ -1528,6 +1529,9 @@ fixup_var_refs (rtx var, enum machine_mode promoted_mode, int unsignedp, return; } + /* Volatile is valid in MEMs because all we're doing in changing the + address inside. */ + volatile_ok = 1; fixup_var_refs_insns (first_insn, var, promoted_mode, unsignedp, stack == 0, may_share); @@ -1555,6 +1559,8 @@ fixup_var_refs (rtx var, enum machine_mode promoted_mode, int unsignedp, end_sequence (); } } + + volatile_ok = save_volatile_ok; } /* REPLACEMENTS is a pointer to a list of the struct fixup_replacement and X is