This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: always use pseudo return regs
- To: Jeffrey Oldham <oldham at codesourcery dot com>
- Subject: Re: always use pseudo return regs
- From: Richard Henderson <rth at redhat dot com>
- Date: Fri, 25 May 2001 12:07:19 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20010525093214.A30239@codesourcery.com>
On Fri, May 25, 2001 at 09:32:14AM -0700, Jeffrey Oldham wrote:
> The 23May patch
> (http://gcc.gnu.org/ml/gcc-patches/2001-05/msg01629.html) to
> gcc/function.c causes gcc 3.1 for mips-sgi-irix6.5 to crash on test
> cases gcc.c-torture/compile/981007-1.c and
> gcc.c-torture/execute/complex-3.c.
The following should cure things. It in effect partially
reverts the change for the cases we didn't handle.
Tested with a mips cross compile of the above tests.
r~
* function.c (expand_function_start): Don't abort on PARALLEL
returns from hard_function_value.
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.271
diff -u -p -c -r1.271 function.c
*** function.c 2001/05/23 07:01:43 1.271
--- function.c 2001/05/25 19:02:50
*************** expand_function_start (subr, parms_have_
*** 6378,6394 ****
= hard_function_value (TREE_TYPE (DECL_RESULT (subr)),
subr, 1);
! /* Since we know the return value is not an aggregate, we should
! have a REG here. */
! if (!REG_P (hard_reg))
! abort ();
! /* Create the pseudo. */
! SET_DECL_RTL (DECL_RESULT (subr),
! gen_reg_rtx (GET_MODE (hard_reg)));
! /* Needed because we may need to move this to memory
! in case it's a named return value whose address is taken. */
! DECL_REGISTER (DECL_RESULT (subr)) = 1;
}
/* Initialize rtx for parameters and local variables.
--- 6378,6396 ----
= hard_function_value (TREE_TYPE (DECL_RESULT (subr)),
subr, 1);
! /* Structures that are returned in registers are not aggregate_value_p,
! so we may see a PARALLEL. Don't play pseudo games with this. */
! if (! REG_P (hard_reg))
! SET_DECL_RTL (DECL_RESULT (subr), hard_reg);
! else
! {
! /* Create the pseudo. */
! SET_DECL_RTL (DECL_RESULT (subr), gen_reg_rtx (GET_MODE (hard_reg)));
! /* Needed because we may need to move this to memory
! in case it's a named return value whose address is taken. */
! DECL_REGISTER (DECL_RESULT (subr)) = 1;
! }
}
/* Initialize rtx for parameters and local variables.