diff options
| author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-28 12:31:40 +0000 |
|---|---|---|
| committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-28 12:31:40 +0000 |
| commit | 9e675ea4e94dd33cfe3b2389aef7bec737f26b1f (patch) | |
| tree | 8259d933168057d7c20100edea0e2f03c1405468 | |
| parent | f642e4c4ca4c45342809d8738f819f32ca96601b (diff) | |
| download | ppe42-gcc-9e675ea4e94dd33cfe3b2389aef7bec737f26b1f.tar.gz ppe42-gcc-9e675ea4e94dd33cfe3b2389aef7bec737f26b1f.zip | |
* function.c (diddle_return_value): A pcc-style struct return
returns a pointer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34230 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/function.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fce1fd1028..01ef6afac32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> * cppfiles.c: Read files in, using mmap if possible, then diff --git a/gcc/function.c b/gcc/function.c index a59de4b3467..07f58d56dbf 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6319,14 +6319,25 @@ diddle_return_value (doit, arg) void *arg; { rtx outgoing = current_function_return_rtx; + int pcc; if (! outgoing) return; - if (GET_CODE (outgoing) == REG - && REGNO (outgoing) >= FIRST_PSEUDO_REGISTER) + pcc = (current_function_returns_struct + || 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)); + + /* 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 outgoing = FUNCTION_OUTGOING_VALUE (type, current_function_decl); #else @@ -6337,6 +6348,7 @@ diddle_return_value (doit, arg) if (GET_MODE (outgoing) == BLKmode) PUT_MODE (outgoing, GET_MODE (DECL_RTL (DECL_RESULT (current_function_decl)))); + REG_FUNCTION_VALUE_P (outgoing) = 1; } if (GET_CODE (outgoing) == REG) |

