diff options
author | Jeffrey A Law <law@cygnus.com> | 1997-11-14 14:06:07 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-11-14 07:06:07 -0700 |
commit | f78b5ca112ef5d3baa8455380553837fa688d9e4 (patch) | |
tree | e2fb28c342648ac9106c1370ad2af4e6b441d4ec | |
parent | 238ad62b9fc6a0290a25467bb49c975e5ea29c92 (diff) | |
download | gcc-f78b5ca112ef5d3baa8455380553837fa688d9e4.zip gcc-f78b5ca112ef5d3baa8455380553837fa688d9e4.tar.gz gcc-f78b5ca112ef5d3baa8455380553837fa688d9e4.tar.bz2 |
* calls.c (expand_call): Handle pcc_struct_value correctly for C++.
From-SVN: r16485
-rw-r--r-- | gcc/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/calls.c | 36 |
2 files changed, 8 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c7b94e..7f0ed57 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,7 @@ Fri Nov 14 06:59:33 1997 Jeffrey A Law (law@cygnus.com) + * calls.c (expand_call): Handle pcc_struct_value correctly for C++. + * i386/xm-cygwin32.h (HAVE_FILE_H, HAVE_RUSAGE): Delete defines. * i386/xm-mingw32.h (HAVE_FILE_H, HAVE_RUSAGE): Likewise. * rs6000/xm-cygwin32.h (HAVE_FILE_H, HAVE_RUSAGE): Likewise. diff --git a/gcc/calls.c b/gcc/calls.c index a70830c..2d94cb6 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2061,36 +2061,12 @@ expand_call (exp, target, ignore) } else if (pcc_struct_value) { - if (target == 0) - { - /* We used leave the value in the location that it is - returned in, but that causes problems if it is used more - than once in one expression. Rather than trying to track - when a copy is required, we always copy when TARGET is - not specified. This calling sequence is only used on - a few machines and TARGET is usually nonzero. */ - if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode) - { - target = assign_stack_temp (BLKmode, - int_size_in_bytes (TREE_TYPE (exp)), - 0); - - MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp)); - - /* Save this temp slot around the pop below. */ - preserve_temp_slots (target); - } - else - target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp))); - } - - if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode) - emit_move_insn (target, gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)), - copy_to_reg (valreg))); - else - emit_block_move (target, gen_rtx (MEM, BLKmode, copy_to_reg (valreg)), - expr_size (exp), - TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT); + /* This is the special C++ case where we need to + know what the true target was. We take care to + never use this value more than once in one expression. */ + target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)), + copy_to_reg (valreg)); + MEM_IN_STRUCT_P (target) = AGGREGATE_TYPE_P (TREE_TYPE (exp)); } /* Handle calls that return values in multiple non-contiguous locations. The Irix 6 ABI has examples of this. */ |