summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-13 21:24:03 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-13 21:24:03 +0000
commit4d6c855d3cd9b2c5c800e51d3f4ee4867b3bb081 (patch)
tree4a996de2ddd3f5c1f463cf95ac72c5df06993459
parent61a6d4a6d4abaf6492cbadb7dafddf62149f9bf6 (diff)
downloadppe42-gcc-4d6c855d3cd9b2c5c800e51d3f4ee4867b3bb081.tar.gz
ppe42-gcc-4d6c855d3cd9b2c5c800e51d3f4ee4867b3bb081.zip
* function.c (assign_parms): Optimize incoming PARALLELs into
REGs if possible. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38233 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/function.c20
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 79fa00c92d7..b3051b6df24 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-12-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * function.c (assign_parms): Optimize incoming PARALLELs into
+ REGs if possible.
+
2000-12-13 Bruce Korb <bkorb@gnu.org>
* fixinc/Makefile.in(*): substantial rewrite to accommodate systems
diff --git a/gcc/function.c b/gcc/function.c
index 5e01c65f5d1..07992162067 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4549,6 +4549,26 @@ assign_parms (fndecl)
&& nominal_mode != BLKmode && nominal_mode != passed_mode)
stack_parm = 0;
+ /* When an argument is passed in multiple locations, we can't
+ make use of this information, but we can save some copying if
+ the whole argument is passed in a single register. */
+ if (GET_CODE (entry_parm) == PARALLEL
+ && nominal_mode != BLKmode && passed_mode != BLKmode)
+ {
+ int i, len = XVECLEN (entry_parm, 0);
+
+ for (i = 0; i < len; i++)
+ if (XEXP (XVECEXP (entry_parm, 0, i), 0) != NULL_RTX
+ && GET_CODE (XEXP (XVECEXP (entry_parm, 0, i), 0)) == REG
+ && (GET_MODE (XEXP (XVECEXP (entry_parm, 0, i), 0))
+ == passed_mode)
+ && XINT (XEXP (XVECEXP (entry_parm, 0, i), 1), 0) == 0)
+ {
+ entry_parm = XEXP (XVECEXP (entry_parm, 0, i), 0);
+ break;
+ }
+ }
+
/* ENTRY_PARM is an RTX for the parameter as it arrives,
in the mode in which it arrives.
STACK_PARM is an RTX for a stack slot where the parameter can live
OpenPOWER on IntegriCloud