This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Minor tweak to function.c:keep_stack_depressed


> This is used only by Ada and only on some targets.
> 
> Wed Dec  5 06:26:27 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
> 
> 	* function.c (keep_stack_depressed): Refine check for register
> 	clobbered over call.
> 

If you want to check that a function has been clobbered over a call you
should, I believe, only check TEST_HARD_REG_BIT
(regs_invalidated_by_call, no) and not check !fixed_regs[regno] as well.
This will give you false positives. See propagate_one_insn for a similar
check.

-eric

> *** function.c	2001/12/04 09:29:52	1.330 --- function.c	2001/12/05
> 11:27:52
> *************** keep_stack_depressed (seq) *** 7275,7279 ****
>   	      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
>   		if (HARD_REGNO_MODE_OK (regno, Pmode)
> ! 		    && !fixed_regs[regno] && call_used_regs[regno]
>   		    && !FUNCTION_VALUE_REGNO_P (regno))
>   		  break;
> --- 7275,7280 ----
>   	      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
>   		if (HARD_REGNO_MODE_OK (regno, Pmode)
> ! 		    && !fixed_regs[regno]
> ! 		    && TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)
>   		    && !FUNCTION_VALUE_REGNO_P (regno))
>   		  break;


-- 
Fridays are not "pants optional"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]