summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-12 23:47:06 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-12 23:47:06 +0000
commitf678883bbb13788bf580ffbb251b491ec475b4c1 (patch)
tree3e9531941b584cf074efa635b43ce94f684623ba /gcc/function.c
parent4f15a1a4672798384e246b4af3df4cca545bba67 (diff)
downloadgcc-f678883bbb13788bf580ffbb251b491ec475b4c1.tar.gz
Jeffrey A Law (law@cygnus.com)
* function.c (purge_addressof): Unshare any shared rtl created by purge_addressof and its children. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33133 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c
index f31e20da448..4b6f5ff1753 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -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 ());
}
/* Pass through the INSNS of function FNDECL and convert virtual register