]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
emit-rtl.c (set_mem_attributes_minus_bitpos): Don't kill previous MEM_VOLATILE in...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Thu, 12 Feb 2004 18:25:09 +0000 (18:25 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 12 Feb 2004 18:25:09 +0000 (13:25 -0500)
* emit-rtl.c (set_mem_attributes_minus_bitpos): Don't kill
previous MEM_VOLATILE in REF.
* 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: r77718

gcc/ChangeLog
gcc/emit-rtl.c
gcc/expr.c
gcc/function.c

index 86685c0471b0dcecd9da49d7d16ef80a11c54d9e..3d38c29aeb5c9ae4dac0f52d757289a72222d833 100644 (file)
@@ -1,3 +1,10 @@
+2004-02-12  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * emit-rtl.c (set_mem_attributes_minus_bitpos): Don't kill
+       previous MEM_VOLATILE in REF.
+       * function.c (fixup_var_refs): Save volatile_ok and set to 1.
+       * expr.c (emit_block_move_via_movstr): Save and restore volatile_ok.
+
 2004-02-12  Gunther Nikl  <gni@gecko.de>
 
        * config.gcc: Restore support for m68k-openbsd.
index 722d697f4c2d0f897102665098f0d9b8e91c35b5..76f292ce4b9bf5f7e2c58ae2b2268093c03b8ca8 100644 (file)
@@ -1479,7 +1479,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
      front-end routine) and use it.  */
   alias = get_alias_set (t);
 
-  MEM_VOLATILE_P (ref) = TYPE_VOLATILE (type);
+  MEM_VOLATILE_P (ref) |= TYPE_VOLATILE (type);
   MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);
   RTX_UNCHANGING_P (ref)
     |= ((lang_hooks.honor_readonly
index 7d6dd16673131c7e7257c104ffea966a170b1ac0..a6d222e339a07ede71cb9a9a0251371f709f3a84 100644 (file)
@@ -1417,6 +1417,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.  */
@@ -1466,7 +1467,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
@@ -1474,7 +1475,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;
 }
 
index e2024f2b26c1ea3f3c1466769de215466527a02b..ca26cf82517ecdb4363bdc43853b203540b87a00 100644 (file)
@@ -1503,6 +1503,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)
@@ -1514,6 +1515,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);
 
@@ -1541,6 +1545,8 @@ fixup_var_refs (rtx var, enum machine_mode promoted_mode, int unsignedp,
          end_sequence ();
        }
     }
+
+  volatile_ok = save_volatile_ok;
 }
 \f
 /* REPLACEMENTS is a pointer to a list of the struct fixup_replacement and X is