summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-02-12 17:29:24 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-02-12 17:29:24 +0000
commitba7da555d95286d6a919985d62bf4851eb2f288e (patch)
tree20fe87ef01d28a66b3f6ad70cdbee70fb8c1fae4 /gcc/calls.c
parentcbc3c863fee6e77e8f81bbd7f80aeb79cc77d59d (diff)
downloadgcc-ba7da555d95286d6a919985d62bf4851eb2f288e.tar.gz
(expand_call): When preserving subexpressions, don't put expensive
arguments directly into hard registers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6543 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 898272db807..4f3e61b36d9 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1,5 +1,5 @@
/* Convert function calls to rtl insns, for GNU C compiler.
- Copyright (C) 1989, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -1566,6 +1566,18 @@ expand_call (exp, target, ignore)
= convert_modes (args[i].mode,
TYPE_MODE (TREE_TYPE (args[i].tree_value)),
args[i].value, args[i].unsignedp);
+
+ /* If the value is expensive, and we are inside an appropriately
+ short loop, put the value into a pseudo and then put the pseudo
+ into the hard reg. */
+
+ if ((! (GET_CODE (args[i].value) == REG
+ || (GET_CODE (args[i].value) == SUBREG
+ && GET_CODE (SUBREG_REG (args[i].value)) == REG)))
+ && args[i].mode != BLKmode
+ && rtx_cost (args[i].value, SET) > 2
+ && preserve_subexpressions_p ())
+ args[i].value = copy_to_mode_reg (args[i].mode, args[i].value);
}
#if defined(ACCUMULATE_OUTGOING_ARGS) && defined(REG_PARM_STACK_SPACE)