This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: use hard_function_value
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: use hard_function_value
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Mon, 17 Apr 2000 17:34:43 -0700
- Organization: CodeSourcery, LLC
I've checked this in, but I wouldn't mind an expert pair of eyes on
the patch.
This C++ code:
struct X
{
};
void (X::* fee ())()
{
lab: goto lab;
}
was causing a compiler abort on mips-sgi-irix6.5. The problem was
that expand_function_start was setting the DECL_RESULT for `fee' to a
BLKmode register, and that hard_reg (via diddle_return_value) unhappy.
I'm not sure exactly how, when, or why this broken -- which makes me
nervous. It appears that `mips_function_value' has always returned
BLKmode registers in this kind of situation, so I don't know why this
didn't fail ages ago. In any case, hard_function_value specifically
checks for this case and fixes up the mode of the register, so it
seems sensible to use that function here.
Thanks in advance for any feedback,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2000-04-17 Mark Mitchell <mark@codesourcery.com>
* function.c (expand_function_start): Use hard_function_value to
compute the RTL to use for DECL_RESULT.
Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.190
diff -c -p -r1.190 function.c
*** function.c 2000/04/12 23:47:06 1.190
--- function.c 2000/04/18 00:02:55
*************** expand_function_start (subr, parms_have_
*** 6182,6194 ****
else
/* Scalar, returned in a register. */
{
- #ifdef FUNCTION_OUTGOING_VALUE
DECL_RTL (DECL_RESULT (subr))
! = FUNCTION_OUTGOING_VALUE (TREE_TYPE (DECL_RESULT (subr)), subr);
! #else
! DECL_RTL (DECL_RESULT (subr))
! = FUNCTION_VALUE (TREE_TYPE (DECL_RESULT (subr)), subr);
! #endif
/* Mark this reg as the function's return value. */
if (GET_CODE (DECL_RTL (DECL_RESULT (subr))) == REG)
--- 6182,6189 ----
else
/* Scalar, returned in a register. */
{
DECL_RTL (DECL_RESULT (subr))
! = hard_function_value (TREE_TYPE (DECL_RESULT (subr)), subr, 1);
/* Mark this reg as the function's return value. */
if (GET_CODE (DECL_RTL (DECL_RESULT (subr))) == REG)