aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/function.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2001-02-17 08:35:00 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2001-02-17 08:35:00 +0000
commit0e907ffc9a0c10ff84206629f49bcfe5dc57dd2a (patch)
treed55df6e3bcb55aa8c2d771b72f467f7deb1369da /contrib/gcc/function.c
parent9520158affacceccad17418766449a7321af6c1f (diff)
downloadsrc-0e907ffc9a0c10ff84206629f49bcfe5dc57dd2a.tar.gz
src-0e907ffc9a0c10ff84206629f49bcfe5dc57dd2a.zip
Merge gcc-2.95.3-test3 changes onto mainline. Bump FreeBSD cc version.
Notes
Notes: svn path=/head/; revision=72564
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 3237efc12767..d199d4275df6 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