diff options
author | Geoff Keating <geoffk@cygnus.com> | 2000-01-27 20:46:26 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2000-01-27 20:46:26 +0000 |
commit | d1b817796193461ca8a39cc93c9662fd9fb3c5c7 (patch) | |
tree | a362d5dd6e2bf7c8fcd3a6b2b1e94b123120c60d /gcc | |
parent | 3bc9f12b33e84053451bac3b5f817526c3792627 (diff) | |
download | gcc-d1b817796193461ca8a39cc93c9662fd9fb3c5c7.zip gcc-d1b817796193461ca8a39cc93c9662fd9fb3c5c7.tar.gz gcc-d1b817796193461ca8a39cc93c9662fd9fb3c5c7.tar.bz2 |
emit-rtl.c (unshare_all_rtl): Unshare virtual parameters too.
* emit-rtl.c (unshare_all_rtl): Unshare virtual parameters too.
Use unshare_all_rtl_1.
(unshare_all_rtl_again): New function.
(unshare_all_rtl_1): New function split out of unshare_all_rtl.
* function.c (purge_addressof_1): Use unshare_all_rtl_again
rather than resetting the 'used' flags ourself.
* toplev.c (rest_of_compilation): Add current_function_decl
to the unshare_all_rtl call.
* tree.h: Prototype unshare_all_rtl.
* rtl.h: Prototype unshare_all_rtl_again here.
From-SVN: r31651
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 65 | ||||
-rw-r--r-- | gcc/function.c | 8 | ||||
-rw-r--r-- | gcc/rtl.h | 2 | ||||
-rw-r--r-- | gcc/toplev.c | 2 | ||||
-rw-r--r-- | gcc/tree.h | 1 |
6 files changed, 71 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2adbce..7d1a9af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,19 @@ -2000-01-24 Geoffrey Keating <geoffk@cygnus.com> +2000-01-27 Geoffrey Keating <geoffk@cygnus.com> + + * emit-rtl.c (unshare_all_rtl): Unshare virtual parameters too. + Use unshare_all_rtl_1. + (unshare_all_rtl_again): New function. + (unshare_all_rtl_1): New function split out of unshare_all_rtl. + + * function.c (purge_addressof_1): Use unshare_all_rtl_again + rather than resetting the 'used' flags ourself. + + * toplev.c (rest_of_compilation): Add current_function_decl + to the unshare_all_rtl call. + * tree.h: Prototype unshare_all_rtl. + * rtl.h: Prototype unshare_all_rtl_again here. + +2000-01-27 Geoffrey Keating <geoffk@cygnus.com> * genoutput.c (output_prologue): Include ggc.h in generated files. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index c8b07a2..7a40b82 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -170,6 +170,7 @@ static rtx make_jump_insn_raw PARAMS ((rtx)); static rtx make_call_insn_raw PARAMS ((rtx)); static rtx find_line_note PARAMS ((rtx)); static void mark_sequence_stack PARAMS ((struct sequence_stack *)); +static void unshare_all_rtl_1 PARAMS ((rtx)); /* There are some RTL codes that require special attention; the generation functions do the raw handling. If you add to this list, modify @@ -1610,23 +1611,25 @@ free_emit_status (f) f->emit = NULL; } -/* 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 parameters are not shared. */ + for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl)) + { + copy_rtx_if_shared (DECL_RTL (decl)); + } + + /* 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. @@ -1634,10 +1637,44 @@ 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. */ - 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)); + } +} + /* Mark ORIG as in use, and return a copy of it if it was already in use. Recursively does the same for subexpressions. */ diff --git a/gcc/function.c b/gcc/function.c index 9006d16..8339208 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2972,13 +2972,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 (); @@ -1445,7 +1445,7 @@ extern void reverse_comparison PARAMS ((rtx)); extern void set_new_first_and_last_insn PARAMS ((rtx, rtx)); extern void set_new_first_and_last_label_num PARAMS ((int, int)); extern void set_new_last_label_num PARAMS ((int)); -extern void unshare_all_rtl PARAMS ((rtx)); +extern void unshare_all_rtl_again PARAMS ((rtx)); extern void set_last_insn PARAMS ((rtx)); extern void link_cc0_insns PARAMS ((rtx)); extern void add_insn PARAMS ((rtx)); diff --git a/gcc/toplev.c b/gcc/toplev.c index c77ea7a..189c3e7 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2944,7 +2944,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); init_EXPR_INSN_LIST_cache (); @@ -2392,6 +2392,7 @@ extern tree reorder_blocks PARAMS ((tree, struct rtx_def *)); extern void free_temps_for_rtl_expr PARAMS ((tree)); extern void instantiate_virtual_regs PARAMS ((tree, struct rtx_def *)); +extern void unshare_all_rtl PARAMS ((tree, struct rtx_def *)); extern int max_parm_reg_num PARAMS ((void)); extern void push_function_context PARAMS ((void)); extern void pop_function_context PARAMS ((void)); |