summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-05 20:13:53 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-05 20:13:53 +0000
commit9c0a756f7c8679b99c754bc72eb1a7a2dd6618d2 (patch)
tree221512a33199a7175b67e219e51648c193b287dc /gcc/calls.c
parent494d463ca679154e9d5b5d92d7b312006e6125f8 (diff)
downloadgcc-9c0a756f7c8679b99c754bc72eb1a7a2dd6618d2.tar.gz
* function.h (virtuals_instantiated): Declare.
* function.c: (virtuals_instantiated): Make global. * calls.c (emit_library_call_value_1): Use virtual_outgoing_args_rtx only if it hasn't been instantiated. Otherwise, use the stack pointer directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41127 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index eb54aee2d8a..d0f3a14038a 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -59,6 +59,10 @@ Boston, MA 02111-1307, USA. */
#define PUSH_ARGS_REVERSED 0
#endif
+#ifndef STACK_POINTER_OFFSET
+#define STACK_POINTER_OFFSET 0
+#endif
+
/* Like PREFERRED_STACK_BOUNDARY but in units of bytes, not bits. */
#define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)
@@ -3820,11 +3824,15 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
highest_outgoing_arg_in_use - initial_highest_arg_in_use);
needed = 0;
- /* The address of the outgoing argument list must not be copied to a
- register here, because argblock would be left pointing to the
- wrong place after the call to allocate_dynamic_stack_space below. */
+ /* We must be careful to use virtual regs before they're instantiated,
+ and real regs afterwards. Loop optimization, for example, can create
+ new libcalls after we've instantiated the virtual regs, and if we
+ use virtuals anyway, they won't match the rtl patterns. */
- argblock = virtual_outgoing_args_rtx;
+ if (virtuals_instantiated)
+ argblock = plus_constant (stack_pointer_rtx, STACK_POINTER_OFFSET);
+ else
+ argblock = virtual_outgoing_args_rtx;
}
else
{