summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/function.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-02-17 08:35:00 +0000
committerobrien <obrien@FreeBSD.org>2001-02-17 08:35:00 +0000
commitb545fa1c7f36557a4a56001324ca9efb4598c7f3 (patch)
tree19ee344f0faac64d0c2730f586da6ccee4ac39f9 /contrib/gcc/function.c
parenta15849488bd68abd478851ec6c349e1eeefa9383 (diff)
downloadFreeBSD-src-b545fa1c7f36557a4a56001324ca9efb4598c7f3.zip
FreeBSD-src-b545fa1c7f36557a4a56001324ca9efb4598c7f3.tar.gz
Merge gcc-2.95.3-test3 changes onto mainline. Bump FreeBSD cc version.
Diffstat (limited to 'contrib/gcc/function.c')
-rw-r--r--contrib/gcc/function.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/contrib/gcc/function.c b/contrib/gcc/function.c
index 3237efc..d199d42 100644
--- a/contrib/gcc/function.c
+++ b/contrib/gcc/function.c
@@ -1,5 +1,6 @@
/* Expands front end tree to back end RTL for GNU C-Compiler
- Copyright (C) 1987, 88, 89, 91-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -3223,13 +3224,7 @@ purge_addressof_1 (loc, insn, force, store, ht)
/* Make sure to unshare any shared rtl that store_bit_field
might have created. */
- for (p = get_insns(); p; p = NEXT_INSN (p))
- {
- reset_used_flags (PATTERN (p));
- reset_used_flags (REG_NOTES (p));
- reset_used_flags (LOG_LINKS (p));
- }
- unshare_all_rtl (get_insns ());
+ unshare_all_rtl_again (get_insns ());
seq = gen_sequence ();
end_sequence ();
@@ -3481,6 +3476,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
OpenPOWER on IntegriCloud