diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-02-24 18:52:23 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-02-24 18:52:23 +0000 |
commit | 1cca8b0da3d704e563e451a70cdec4da6d42904b (patch) | |
tree | d0b9f12c35a7f1f24b44614d56262e448b4c4839 | |
parent | 251222fe41d930f57b81936411de3439f83583a7 (diff) |
Automatic conflict resolution
-rw-r--r-- | gnu/egcs/gcc/Makefile.in | 3 | ||||
-rw-r--r-- | gnu/egcs/gcc/collect2.c | 3 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/m68k/m68k.h | 3 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/rs6000/sysv4.h | 2 | ||||
-rw-r--r-- | gnu/egcs/gcc/configure.in | 2 | ||||
-rw-r--r-- | gnu/egcs/gcc/cse.c | 3 | ||||
-rw-r--r-- | gnu/egcs/gcc/emit-rtl.c | 108 | ||||
-rw-r--r-- | gnu/egcs/gcc/function.c | 25 | ||||
-rw-r--r-- | gnu/egcs/gcc/gcc.c | 3 | ||||
-rw-r--r-- | gnu/egcs/gcc/invoke.texi | 3 | ||||
-rw-r--r-- | gnu/egcs/gcc/rtl.h | 5 | ||||
-rw-r--r-- | gnu/egcs/gcc/toplev.c | 5 |
12 files changed, 130 insertions, 35 deletions
diff --git a/gnu/egcs/gcc/Makefile.in b/gnu/egcs/gcc/Makefile.in index 02e2d57c263..ac9959a3977 100644 --- a/gnu/egcs/gcc/Makefile.in +++ b/gnu/egcs/gcc/Makefile.in @@ -1,5 +1,6 @@ # Makefile for GNU C compiler. -# Copyright (C) 1987, 88, 90-98, 1999 Free Software Foundation, Inc. +# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, +# 1998, 1999, 2000 Free Software Foundation, Inc. #This file is part of GNU CC. diff --git a/gnu/egcs/gcc/collect2.c b/gnu/egcs/gcc/collect2.c index 42329c0c661..50bb9feb804 100644 --- a/gnu/egcs/gcc/collect2.c +++ b/gnu/egcs/gcc/collect2.c @@ -1,6 +1,7 @@ /* Collect static initialization info into data structures that can be traversed by C++ initialization and finalization routines. - Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Contributed by Chris Smith (csmith@convex.com). Heavily modified by Michael Meissner (meissner@cygnus.com), Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com). diff --git a/gnu/egcs/gcc/config/m68k/m68k.h b/gnu/egcs/gcc/config/m68k/m68k.h index f7dee26e1aa..ee0dc755ce2 100644 --- a/gnu/egcs/gcc/config/m68k/m68k.h +++ b/gnu/egcs/gcc/config/m68k/m68k.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler. Sun 68000/68020 version. - Copyright (C) 1987, 88, 93-98, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gnu/egcs/gcc/config/rs6000/sysv4.h b/gnu/egcs/gcc/config/rs6000/sysv4.h index c242e1d9faa..541b06cadd0 100644 --- a/gnu/egcs/gcc/config/rs6000/sysv4.h +++ b/gnu/egcs/gcc/config/rs6000/sysv4.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for PowerPC running System V.4 - Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GNU CC. diff --git a/gnu/egcs/gcc/configure.in b/gnu/egcs/gcc/configure.in index 268894c5d99..8e759c3101e 100644 --- a/gnu/egcs/gcc/configure.in +++ b/gnu/egcs/gcc/configure.in @@ -1,7 +1,7 @@ # configure.in for GNU CC # Process this file with autoconf to generate a configuration script. -# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +# Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. #This file is part of GNU CC. diff --git a/gnu/egcs/gcc/cse.c b/gnu/egcs/gcc/cse.c index 8b87c72fb1e..2947d8ef6a6 100644 --- a/gnu/egcs/gcc/cse.c +++ b/gnu/egcs/gcc/cse.c @@ -1,5 +1,6 @@ /* Common subexpression elimination for GNU compiler. - Copyright (C) 1987, 88, 89, 92-99, 2000 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gnu/egcs/gcc/emit-rtl.c b/gnu/egcs/gcc/emit-rtl.c index 54cee163738..79104729af6 100644 --- a/gnu/egcs/gcc/emit-rtl.c +++ b/gnu/egcs/gcc/emit-rtl.c @@ -1,5 +1,6 @@ /* Emit RTL for the GNU C-Compiler expander. - Copyright (C) 1987, 88, 92-97, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -248,6 +249,9 @@ extern int emit_lineno; static rtx make_jump_insn_raw PROTO((rtx)); static rtx make_call_insn_raw PROTO((rtx)); static rtx find_line_note PROTO((rtx)); +static void unshare_all_rtl_1 PROTO((rtx)); +static void unshare_all_decls PROTO((tree)); +static void reset_used_decls PROTO((tree)); rtx gen_rtx_CONST_INT (mode, arg) @@ -1767,23 +1771,29 @@ restore_emit_status (p) free_insn = 0; } -/* Go through all the RTL insn bodies and copy any invalid shared structure. - It does not work to do this twice, because the mark bits set here - are not cleared afterwards. */ +/* Go through all the RTL insn bodies and copy any invalid shared + structure. This routine should only be called once. */ void -unshare_all_rtl (insn) - register rtx insn; +unshare_all_rtl (fndecl, insn) + tree fndecl; + rtx insn; { - for (; insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN - || GET_CODE (insn) == CALL_INSN) - { - PATTERN (insn) = copy_rtx_if_shared (PATTERN (insn)); - REG_NOTES (insn) = copy_rtx_if_shared (REG_NOTES (insn)); - LOG_LINKS (insn) = copy_rtx_if_shared (LOG_LINKS (insn)); - } + tree decl; + + /* Make sure that virtual stack slots are not shared. */ + reset_used_decls (DECL_INITIAL (current_function_decl)); + + /* Make sure that virtual parameters are not shared. */ + for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl)) + DECL_RTL (decl) = copy_rtx_if_shared (DECL_RTL (decl)); + /* Make sure that virtual stack slots are not shared. */ + unshare_all_decls (DECL_INITIAL (fndecl)); + + /* Unshare just about everything else. */ + unshare_all_rtl_1 (insn); + /* Make sure the addresses of stack slots found outside the insn chain (such as, in DECL_RTL of a variable) are not shared with the insn chain. @@ -1791,8 +1801,76 @@ unshare_all_rtl (insn) This special care is necessary when the stack slot MEM does not actually appear in the insn chain. If it does appear, its address is unshared from all else at that point. */ + stack_slot_list = copy_rtx_if_shared (stack_slot_list); +} + +/* Go through all the RTL insn bodies and copy any invalid shared + structure, again. This is a fairly expensive thing to do so it + should be done sparingly. */ + +void +unshare_all_rtl_again (insn) + rtx insn; +{ + rtx p; + for (p = insn; p; p = NEXT_INSN (p)) + if (GET_RTX_CLASS (GET_CODE (p)) == 'i') + { + reset_used_flags (PATTERN (p)); + reset_used_flags (REG_NOTES (p)); + reset_used_flags (LOG_LINKS (p)); + } + unshare_all_rtl_1 (insn); +} + +/* Go through all the RTL insn bodies and copy any invalid shared structure. + Assumes the mark bits are cleared at entry. */ + +static void +unshare_all_rtl_1 (insn) + rtx insn; +{ + for (; insn; insn = NEXT_INSN (insn)) + if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') + { + PATTERN (insn) = copy_rtx_if_shared (PATTERN (insn)); + REG_NOTES (insn) = copy_rtx_if_shared (REG_NOTES (insn)); + LOG_LINKS (insn) = copy_rtx_if_shared (LOG_LINKS (insn)); + } +} + +/* Go through all virtual stack slots of a function and copy any + shared structure. */ +static void +unshare_all_decls (blk) + tree blk; +{ + tree t; + + /* Copy shared decls. */ + for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t)) + DECL_RTL (t) = copy_rtx_if_shared (DECL_RTL (t)); + + /* Now process sub-blocks. */ + for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t)) + unshare_all_decls (t); +} + +/* Go through all virtual stack slots of a function and mark them as + not shared. */ +static void +reset_used_decls (blk) + tree blk; +{ + tree t; + + /* Mark decls. */ + for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t)) + reset_used_flags (DECL_RTL (t)); - copy_rtx_if_shared (stack_slot_list); + /* Now process sub-blocks. */ + for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t)) + reset_used_decls (t); } /* Mark ORIG as in use, and return a copy of it if it was already in use. diff --git a/gnu/egcs/gcc/function.c b/gnu/egcs/gcc/function.c index a4033a9a6b8..edd0bca1216 100644 --- a/gnu/egcs/gcc/function.c +++ b/gnu/egcs/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. @@ -3221,13 +3222,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 (); @@ -3479,6 +3474,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 diff --git a/gnu/egcs/gcc/gcc.c b/gnu/egcs/gcc/gcc.c index 4d025dbe6e6..d62815473b9 100644 --- a/gnu/egcs/gcc/gcc.c +++ b/gnu/egcs/gcc/gcc.c @@ -1,5 +1,6 @@ /* Compiler driver program that can handle many languages. - Copyright (C) 1987, 89, 92-98, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000 Free Software Foundation, Inc. This file is part of GNU CC. diff --git a/gnu/egcs/gcc/invoke.texi b/gnu/egcs/gcc/invoke.texi index 58a54b149f3..01a4c5038af 100644 --- a/gnu/egcs/gcc/invoke.texi +++ b/gnu/egcs/gcc/invoke.texi @@ -1,4 +1,5 @@ -@c Copyright (C) 1988, 89, 92-98, 1999 Free Software Foundation, Inc. +@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +@c 2000, 2001 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. diff --git a/gnu/egcs/gcc/rtl.h b/gnu/egcs/gcc/rtl.h index 0f43e87dc75..efbf588d769 100644 --- a/gnu/egcs/gcc/rtl.h +++ b/gnu/egcs/gcc/rtl.h @@ -1,5 +1,6 @@ /* Register Transfer Language (RTL) definitions for GNU C-Compiler - Copyright (C) 1987, 91-98, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -1391,7 +1392,7 @@ extern int subreg_realpart_p PROTO ((rtx)); extern void reverse_comparison PROTO ((rtx)); extern void set_new_first_and_last_insn PROTO ((rtx, rtx)); extern void set_new_first_and_last_label_num PROTO ((int, int)); -extern void unshare_all_rtl PROTO ((rtx)); +extern void unshare_all_rtl_again PROTO ((rtx)); extern void set_last_insn PROTO ((rtx)); extern void link_cc0_insns PROTO ((rtx)); extern void add_insn PROTO ((rtx)); diff --git a/gnu/egcs/gcc/toplev.c b/gnu/egcs/gcc/toplev.c index 242a73cb860..5f8913fa3e5 100644 --- a/gnu/egcs/gcc/toplev.c +++ b/gnu/egcs/gcc/toplev.c @@ -1,5 +1,6 @@ /* Top level of GNU C compiler - Copyright (C) 1987, 88, 89, 92-99, 2000 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. @@ -3816,7 +3817,7 @@ rest_of_compilation (decl) /* Copy any shared structure that should not be shared. */ - unshare_all_rtl (insns); + unshare_all_rtl (current_function_decl, insns); #ifdef SETJMP_VIA_SAVE_AREA /* This must be performed before virutal register instantiation. */ |