Commit 5828d725 by Richard Henderson Committed by Richard Henderson

function.c (diddle_return_value): A pcc-style struct return returns a pointer.

        * function.c (diddle_return_value): A pcc-style struct return
        returns a pointer.

From-SVN: r34230
parent 6745c1b9
2000-05-28 Richard Henderson <rth@cygnus.com>
* function.c (diddle_return_value): A pcc-style struct return
returns a pointer.
2000-05-27 Zack Weinberg <zack@wolery.cumb.org> 2000-05-27 Zack Weinberg <zack@wolery.cumb.org>
* cppfiles.c: Read files in, using mmap if possible, then * cppfiles.c: Read files in, using mmap if possible, then
...@@ -6319,14 +6319,25 @@ diddle_return_value (doit, arg) ...@@ -6319,14 +6319,25 @@ diddle_return_value (doit, arg)
void *arg; void *arg;
{ {
rtx outgoing = current_function_return_rtx; rtx outgoing = current_function_return_rtx;
int pcc;
if (! outgoing) if (! outgoing)
return; return;
if (GET_CODE (outgoing) == REG pcc = (current_function_returns_struct
&& REGNO (outgoing) >= FIRST_PSEUDO_REGISTER) || current_function_returns_pcc_struct);
if ((GET_CODE (outgoing) == REG
&& REGNO (outgoing) >= FIRST_PSEUDO_REGISTER)
|| pcc)
{ {
tree type = TREE_TYPE (DECL_RESULT (current_function_decl)); tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
/* A PCC-style return returns a pointer to the memory in which
the structure is stored. */
if (pcc)
type = build_pointer_type (type);
#ifdef FUNCTION_OUTGOING_VALUE #ifdef FUNCTION_OUTGOING_VALUE
outgoing = FUNCTION_OUTGOING_VALUE (type, current_function_decl); outgoing = FUNCTION_OUTGOING_VALUE (type, current_function_decl);
#else #else
...@@ -6337,6 +6348,7 @@ diddle_return_value (doit, arg) ...@@ -6337,6 +6348,7 @@ diddle_return_value (doit, arg)
if (GET_MODE (outgoing) == BLKmode) if (GET_MODE (outgoing) == BLKmode)
PUT_MODE (outgoing, PUT_MODE (outgoing,
GET_MODE (DECL_RTL (DECL_RESULT (current_function_decl)))); GET_MODE (DECL_RTL (DECL_RESULT (current_function_decl))));
REG_FUNCTION_VALUE_P (outgoing) = 1;
} }
if (GET_CODE (outgoing) == REG) if (GET_CODE (outgoing) == REG)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment