function.c (assign_parms): Optimize incoming PARALLELs into REGs if possible.
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 13 Dec 2000 21:24:03 +0000 (21:24 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 13 Dec 2000 21:24:03 +0000 (21:24 +0000)
* function.c (assign_parms): Optimize incoming PARALLELs into
REGs if possible.

From-SVN: r38233

gcc/ChangeLog
gcc/function.c

index 79fa00c92d73bad0f71793880b7d4701e1f825cf..b3051b6df24d861933b37a948aa93d87f75c8925 100644 (file)
@@ -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
index 5e01c65f5d1fd5b719d0e7cef7dc283eda4caf46..07992162067afb7cb6d47ffab73f5a37f9e93de9 100644 (file)
@@ -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