Fix for problem with unnecessary volatile mems.
authorJames E Wilson <wilson@specifixinc.com>
Thu, 11 Dec 2003 19:04:07 +0000 (19:04 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 11 Dec 2003 19:04:07 +0000 (11:04 -0800)
PR target/13132
* function.c (gen_mem_addressof): When no decl, explicitly clear flag
bits.

From-SVN: r74543

gcc/ChangeLog
gcc/function.c

index 7264d56b840e84650f8028af5c5737925465f53a..e05d2afd0356a0119c70e728bc48d1ac19c59a5c 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-11  James E Wilson  <wilson@specifixinc.com>
+
+       PR target/13132
+       * function.c (gen_mem_addressof): When no decl, explicitly clear flag
+       bits.
+
 2003-12-12  Nick Clifton  <nickc@redhat.com>
 
        * config/m32r/m32r.c: Convert to ISO-C
index 2f6fb9bd1434c75ec58e7a28a77ecd363d7df9f3..7ae19d50efac8dcbadcc97ac4c13565ec07a8a1c 100644 (file)
@@ -2868,7 +2868,17 @@ gen_mem_addressof (rtx reg, tree decl, int rescan)
        fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type), reg, 0);
     }
   else if (rescan)
-    fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0);
+    {
+      /* This can only happen during reload.  Clear the same flag bits as
+        reload.  */
+      MEM_VOLATILE_P (reg) = 0;
+      RTX_UNCHANGING_P (reg) = 0;
+      MEM_IN_STRUCT_P (reg) = 0;
+      MEM_SCALAR_P (reg) = 0;
+      MEM_ATTRS (reg) = 0;
+
+      fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0);
+    }
 
   return reg;
 }