aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-03-23 22:12:22 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-03-23 17:12:22 -0500
commit25a1fcb433c7e1aef52102292a77483753418e32 (patch)
treedd25ec5db7e8a967668ec09dccd7b3a54a0c1657 /gcc/calls.c
parent4b2a62db33607b4e900ff793150ee996e9281420 (diff)
downloadgcc-25a1fcb433c7e1aef52102292a77483753418e32.zip
gcc-25a1fcb433c7e1aef52102292a77483753418e32.tar.gz
gcc-25a1fcb433c7e1aef52102292a77483753418e32.tar.bz2
calls.c (expand_call): If TARGET is passed by reference and is readonly, write a CLOBBER.
* calls.c (expand_call): If TARGET is passed by reference and is readonly, write a CLOBBER. From-SVN: r32716
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 4c8d573..dfb38ee 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2776,6 +2776,14 @@ expand_call (exp, target, ignore)
if (is_longjmp)
current_function_calls_longjmp = 1, sibcall_failure = 1;
+ /* If this function is returning into a memory location marked as
+ readonly, it means it is initializing that location. But we normally
+ treat functions as not clobbering such locations, so we need to
+ specify that this one does. */
+ if (target != 0 && GET_CODE (target) == MEM
+ && structure_value_addr != 0 && RTX_UNCHANGING_P (target))
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
+
/* If value type not void, return an rtx for the value. */
/* If there are cleanups to be called, don't use a hard reg as target.