diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-28 00:12:41 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-28 00:12:41 +0000 |
commit | f24e9d92692a8345c79531ba22825135cd15a32a (patch) | |
tree | 2736d7d7941b48fd63e1b71a3c5182d1b4de78d8 /gcc/flow.c | |
parent | 178f13e60fdc7668e83d934df00de60c3a7a2905 (diff) | |
download | gcc-f24e9d92692a8345c79531ba22825135cd15a32a.tar.gz |
* basic-block.h (basic_block_computed_jump_target): Declare.
* flags.h: (current_function_has_computed_jump): Declare.
* flow.c: (basic_block_computed_jump_target): Define.
(flow_analysis): Allocate it. Set current_function_has_computed_jump
to 0.
(find_basic_blocks): Set current_function_has_computed_jump and
elements of basic_block_computed_jump_target to 1 as appropriate.
* function.c: (current_function_has_computed_jump): Define.
* global.c (global_conflicts): Don't allocate pseudos into stack regs
at the start of a block that is reachable by a computed jump.
* reg-stack.c (stack_reg_life_analysis): If must restart, do so
immediately.
(subst_stack_regs): Undo change from Sep 4 1997.
(uses_reg_or_mem): Now unused, deleted.
* stupid.c (stupid_life_analysis): Compute
current_function_has_computed_jump.
(stupid_find_reg): Don't allocate stack regs if the function has a
computed goto.
* haifa-sched.c (is_cfg_nonregular): Delete code to determine if
the current function has a computed jump. Use the global value
instead.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18860 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flow.c')
-rw-r--r-- | gcc/flow.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/gcc/flow.c b/gcc/flow.c index e5fe0105867..7c6a17f0e75 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -197,6 +197,11 @@ rtx *basic_block_head; rtx *basic_block_end; +/* Element N indicates whether basic block N can be reached through a + computed jump. */ + +char *basic_block_computed_jump_target; + /* Element N is a regset describing the registers live at the start of basic block N. This info lasts until we finish compiling the function. */ @@ -354,6 +359,7 @@ find_basic_blocks (f, nregs, file, live_reachable_p) basic_block_head = (rtx *) xmalloc (n_basic_blocks * sizeof (rtx)); basic_block_end = (rtx *) xmalloc (n_basic_blocks * sizeof (rtx)); basic_block_drops_in = (char *) xmalloc (n_basic_blocks); + basic_block_computed_jump_target = (char *) oballoc (n_basic_blocks); basic_block_loop_depth = (short *) xmalloc (n_basic_blocks * sizeof (short)); uid_block_number = (int *) xmalloc ((max_uid_for_flow + 1) * sizeof (int)); @@ -403,7 +409,9 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p) block_live_static = block_live; bzero (block_live, n_basic_blocks); bzero (block_marked, n_basic_blocks); + bzero (basic_block_computed_jump_target, n_basic_blocks); bzero (active_eh_handler, (max_uid_for_flow + 1) * sizeof (rtx)); + current_function_has_computed_jump = 0; /* Initialize with just block 0 reachable and no blocks marked. */ if (n_basic_blocks > 0) @@ -611,16 +619,25 @@ find_basic_blocks_1 (f, nonlocal_label_list, live_reachable_p) and forced_labels list. */ if (computed_jump_p (insn)) { + current_function_has_computed_jump = 1; for (x = label_value_list; x; x = XEXP (x, 1)) - mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, - XEXP (x, 0)), - insn, 0); + { + int b = BLOCK_NUM (XEXP (x, 0)); + basic_block_computed_jump_target[b] = 1; + mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, + XEXP (x, 0)), + insn, 0); + } for (x = forced_labels; x; x = XEXP (x, 1)) - mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, - XEXP (x, 0)), - insn, 0); - } + { + int b = BLOCK_NUM (XEXP (x, 0)); + basic_block_computed_jump_target[b] = 1; + mark_label_ref (gen_rtx_LABEL_REF (VOIDmode, + XEXP (x, 0)), + insn, 0); + } + } /* If this is a CALL_INSN, then mark it as reaching the active EH handler for this CALL_INSN. If |