From f24e9d92692a8345c79531ba22825135cd15a32a Mon Sep 17 00:00:00 2001 From: law Date: Sat, 28 Mar 1998 00:12:41 +0000 Subject: * 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 --- gcc/stupid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gcc/stupid.c') diff --git a/gcc/stupid.c b/gcc/stupid.c index 3af13a104b0..8b1153682fa 100644 --- a/gcc/stupid.c +++ b/gcc/stupid.c @@ -130,6 +130,8 @@ stupid_life_analysis (f, nregs, file) register rtx last, insn; int max_uid, max_suid; + current_function_has_computed_jump = 0; + bzero (regs_ever_live, sizeof regs_ever_live); regs_live = (char *) alloca (nregs); @@ -265,6 +267,8 @@ stupid_life_analysis (f, nregs, file) be live if it's also used to pass arguments. */ stupid_mark_refs (CALL_INSN_FUNCTION_USAGE (insn), insn); } + if (GET_CODE (insn) == JUMP_INSN && computed_jump_p (insn)) + current_function_has_computed_jump = 1; } /* Now decide the order in which to allocate the pseudo registers. */ @@ -394,6 +398,12 @@ stupid_find_reg (call_preserved, class, mode, for (ins = born_insn; ins < dead_insn; ins++) IOR_HARD_REG_SET (used, after_insn_hard_regs[ins]); +#ifdef STACK_REGS + if (current_function_has_computed_jump) + for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++) + SET_HARD_REG_BIT (used, i); +#endif + IOR_COMPL_HARD_REG_SET (used, reg_class_contents[(int) class]); #ifdef CLASS_CANNOT_CHANGE_SIZE -- cgit v1.2.1