diff options
author | Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> | 1998-03-28 00:12:41 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-03-27 17:12:41 -0700 |
commit | 4d1d804584e7b0795a7c355d3a9cafaa947f1071 (patch) | |
tree | 2736d7d7941b48fd63e1b71a3c5182d1b4de78d8 /gcc/reg-stack.c | |
parent | 56f28b73e7dbb93306da989b3984dd78f918b3e6 (diff) | |
download | gcc-4d1d804584e7b0795a7c355d3a9cafaa947f1071.zip gcc-4d1d804584e7b0795a7c355d3a9cafaa947f1071.tar.gz gcc-4d1d804584e7b0795a7c355d3a9cafaa947f1071.tar.bz2 |
basic-block.h (basic_block_computed_jump_target): Declare.
* 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.
Co-Authored-By: Jeffrey A Law <law@cygnus.com>
From-SVN: r18860
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r-- | gcc/reg-stack.c | 68 |
1 files changed, 1 insertions, 67 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 3a2fe43..0d17f3f 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -249,7 +249,6 @@ static void record_reg_life_pat PROTO((rtx, HARD_REG_SET *, static void get_asm_operand_lengths PROTO((rtx, int, int *, int *)); static void record_reg_life PROTO((rtx, int, stack)); static void find_blocks PROTO((rtx)); -static int uses_reg_or_mem PROTO((rtx)); static rtx stack_result PROTO((tree)); static void stack_reg_life_analysis PROTO((rtx, HARD_REG_SET *)); static void replace_reg PROTO((rtx *, int)); @@ -1403,38 +1402,6 @@ find_blocks (first) } } -/* Return 1 if X contain a REG or MEM that is not in the constant pool. */ - -static int -uses_reg_or_mem (x) - rtx x; -{ - enum rtx_code code = GET_CODE (x); - int i, j; - char *fmt; - - if (code == REG - || (code == MEM - && ! (GET_CODE (XEXP (x, 0)) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0))))) - return 1; - - fmt = GET_RTX_FORMAT (code); - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - { - if (fmt[i] == 'e' - && uses_reg_or_mem (XEXP (x, i))) - return 1; - - if (fmt[i] == 'E') - for (j = 0; j < XVECLEN (x, i); j++) - if (uses_reg_or_mem (XVECEXP (x, i, j))) - return 1; - } - - return 0; -} - /* If current function returns its result in an fp stack register, return the REG. Otherwise, return 0. */ @@ -1583,6 +1550,7 @@ stack_reg_life_analysis (first, stackentry) block = jump_block; must_restart = 1; + break; win: ; @@ -2730,7 +2698,6 @@ subst_stack_regs (insn, regstack) { register rtx *note_link, note; register int i; - rtx head, jump, pat, cipat; int n_operands; if (GET_CODE (insn) == CALL_INSN) @@ -2802,39 +2769,6 @@ subst_stack_regs (insn, regstack) if (GET_CODE (insn) == NOTE) return; - /* If we are reached by a computed goto which sets this same stack register, - then pop this stack register, but maintain regstack. */ - - pat = single_set (insn); - if (pat != 0 - && INSN_UID (insn) <= max_uid - && GET_CODE (block_begin[BLOCK_NUM(insn)]) == CODE_LABEL - && GET_CODE (pat) == SET && STACK_REG_P (SET_DEST (pat))) - for (head = block_begin[BLOCK_NUM(insn)], jump = LABEL_REFS (head); - jump != head; - jump = LABEL_NEXTREF (jump)) - { - cipat = single_set (CONTAINING_INSN (jump)); - if (cipat != 0 - && GET_CODE (cipat) == SET - && SET_DEST (cipat) == pc_rtx - && uses_reg_or_mem (SET_SRC (cipat)) - && INSN_UID (CONTAINING_INSN (jump)) <= max_uid) - { - int from_block = BLOCK_NUM (CONTAINING_INSN (jump)); - if (TEST_HARD_REG_BIT (block_out_reg_set[from_block], - REGNO (SET_DEST (pat)))) - { - struct stack_def old; - bcopy (regstack->reg, old.reg, sizeof (old.reg)); - emit_pop_insn (insn, regstack, SET_DEST (pat), emit_insn_before); - regstack->top += 1; - bcopy (old.reg, regstack->reg, sizeof (old.reg)); - SET_HARD_REG_BIT (regstack->reg_set, REGNO (SET_DEST (pat))); - } - } - } - /* If there is a REG_UNUSED note on a stack register on this insn, the indicated reg must be popped. The REG_UNUSED note is removed, since the form of the newly emitted pop insn references the reg, |