summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-17 07:35:40 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-17 07:35:40 +0000
commit8700bf9e1de4225ebab300aeecfc96654a1074ba (patch)
treec19aa88b81db253df6cd1adc638ebed96d974607 /gcc/calls.c
parent9cc65060239f1627691f4a3871f2848f3902c96c (diff)
downloadgcc-8700bf9e1de4225ebab300aeecfc96654a1074ba.tar.gz
PR rtl-optimization/52773
* calls.c (emit_library_call_value): When pushing arguments use stack_pointer_rtx rather than virtual_outgoing_args_rtx in CALL_INSN_FUNCTION_USAGE. Only emit one of use of the magic stack pointer reference into CALL_INSN_FUNCTION_USAGE. PR rtl-optimization/52773 * gcc.c-torture/compile/pr52773.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219796 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 1c2f0adfa23..ec44624d7c9 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3808,6 +3808,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
int reg_parm_stack_space = 0;
int needed;
rtx_insn *before_call;
+ bool have_push_fusage;
tree tfom; /* type_for_mode (outmode, 0) */
#ifdef REG_PARM_STACK_SPACE
@@ -4165,6 +4166,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
/* Push the args that need to be pushed. */
+ have_push_fusage = false;
+
/* ARGNUM indexes the ARGVEC array in the order in which the arguments
are to be pushed. */
for (count = 0; count < nargs; count++, argnum--)
@@ -4256,14 +4259,19 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
if (argblock)
use = plus_constant (Pmode, argblock,
argvec[argnum].locate.offset.constant);
+ else if (have_push_fusage)
+ continue;
else
- /* When arguments are pushed, trying to tell alias.c where
- exactly this argument is won't work, because the
- auto-increment causes confusion. So we merely indicate
- that we access something with a known mode somewhere on
- the stack. */
- use = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
- gen_rtx_SCRATCH (Pmode));
+ {
+ /* When arguments are pushed, trying to tell alias.c where
+ exactly this argument is won't work, because the
+ auto-increment causes confusion. So we merely indicate
+ that we access something with a known mode somewhere on
+ the stack. */
+ use = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ gen_rtx_SCRATCH (Pmode));
+ have_push_fusage = true;
+ }
use = gen_rtx_MEM (argvec[argnum].mode, use);
use = gen_rtx_USE (VOIDmode, use);
call_fusage = gen_rtx_EXPR_LIST (VOIDmode, use, call_fusage);