RFA: Fix sh-elf -m2 newlib/libm/math/e_atan2.c build failure

Joern Rennecke joern.rennecke@superh.com
Fri Jun 27 16:59:00 GMT 2003


caller-save.c tries to save/restore r1 across a sibcall; this
causes an abort since r1 was not supposed to be used for caller-save.
The problem is that r1 is part of the return value, and flow
propagates the lifeness of all but the first register of the return
value from the exit block across sibcalls.
The comment there indicates that it was supposed to exclude the whole
return value, but it falls short of this because it uses
FUNCTION_VALUE_REGNO_P.

I'm currently bootstrapping with this patch on i686-pc-linux-gnu. 
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
-------------- next part --------------
2003-06-27  J"orn Rennecke <joern.rennecke@superh.com>

	* flow.c (propagate_one_insn): Use proper test for a register
	being part of the return value.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.556
diff -p -r1.556 flow.c
*** flow.c	26 Jun 2003 20:45:18 -0000	1.556
--- flow.c	27 Jun 2003 16:23:14 -0000
*************** propagate_one_insn (pbi, insn)
*** 1808,1814 ****
  	    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)
  		&& ! (sibcall_p
  		      && REGNO_REG_SET_P (live_at_end, i)
! 		      && !FUNCTION_VALUE_REGNO_P (i)))
  	      {
  		/* We do not want REG_UNUSED notes for these registers.  */
  		mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
--- 1808,1816 ----
  	    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)
  		&& ! (sibcall_p
  		      && REGNO_REG_SET_P (live_at_end, i)
! 		      && ! refers_to_regno_p (i, i+1,
! 					      current_function_return_rtx,
! 					      (rtx *) 0)))
  	      {
  		/* We do not want REG_UNUSED notes for these registers.  */
  		mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,


More information about the Gcc-patches mailing list