Jeffrey A Law (law@cygnus.com)
authorJeffrey A Law <law@cygnus.com>
Wed, 12 Apr 2000 23:47:06 +0000 (23:47 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 12 Apr 2000 23:47:06 +0000 (16:47 -0700)
        * function.c (purge_addressof): Unshare any shared rtl created by
        purge_addressof and its children.

From-SVN: r33133

gcc/ChangeLog
gcc/function.c

index 3f6949651c1381dab971ede7b54bc22a3f4d2c30..6131937a3c6ee42637b14b04415226a7afa9c8d1 100644 (file)
@@ -1,3 +1,8 @@
+2000-04-12  Jeffrey A Law  (law@cygnus.com)
+
+       * function.c (purge_addressof): Unshare any shared rtl created by
+       purge_addressof and its children.
+
 2000-04-12  Mark Mitchell  <mark@codesourcery.com>
 
        * function.c (aggregate_value_p): VOID_TYPE nodes are never
index f31e20da448a91c2d792546fd9bcf57fe4404ab5..4b6f5ff17539f220f889bd06e020de821cd531b9 100644 (file)
@@ -3330,6 +3330,20 @@ purge_addressof (insns)
   hash_table_free (&ht);
   purge_bitfield_addressof_replacements = 0;
   purge_addressof_replacements = 0;
+
+  /* REGs are shared.  purge_addressof will destructively replace a REG
+     with a MEM, which creates shared MEMs.
+
+     Unfortunately, the children of put_reg_into_stack assume that MEMs
+     referring to the same stack slot are shared (fixup_var_refs and
+     the associated hash table code).
+
+     So, we have to do another unsharing pass after we have flushed any
+     REGs that had their address taken into the stack.
+
+     It may be worth tracking whether or not we converted any REGs into
+     MEMs to avoid this overhead when it is not needed.  */
+  unshare_all_rtl_again (get_insns ());
 }
 \f
 /* Pass through the INSNS of function FNDECL and convert virtual register