diff options
Diffstat (limited to 'contrib/gcc/function.c')
-rw-r--r-- | contrib/gcc/function.c | 25 |
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 |