reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT end of lifetime and...
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Thu, 21 May 1998 11:52:31 +0000 (11:52 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Thu, 21 May 1998 11:52:31 +0000 (12:52 +0100)
* reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT
end of lifetime and RELOAD_FOR_OUTPUT start of lifetime.

From-SVN: r19929

gcc/ChangeLog
gcc/reload1.c

index 077c913a85b3052732e9e02181e30455eb4761e9..1bca42dae8c745de89ae321dac6a26217f30d8a8 100644 (file)
@@ -1,3 +1,8 @@
+Thu May 21 19:50:13 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * reload1.c (reload_reg_free_for_value_p): Fix RELOAD_FOR_INPUT
+       end of lifetime and RELOAD_FOR_OUTPUT start of lifetime.
+
 Thu May 21 19:32:27 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * combine.c (nonzero_bits): For paradoxical subregs, take
index e3bc950c08f2c78ebed1a7eb8a982f7012002ff3..e0602bed2aee0c1c68655532df4bfc170c94151e 100644 (file)
@@ -5003,7 +5003,14 @@ reload_reg_free_for_value_p (regno, opnum, type, value)
      monotonic.
      Some reload types use different 'buckets' for each operand.
      So there are MAX_RECOG_OPERANDS different time values for each
-     such reload type.  */
+     such reload type.
+     We compute TIME1 as the time when the register for the prospective
+     new reload ceases to be live, and TIME2 for each existing
+     reload as the time when that the reload register of that reload
+     becomes live.
+     Where there is little to be gained by exact lifetime calculations,
+     we just make conservative assumptions, i.e. a longer lifetime;
+     this is done in the 'default:' cases.  */
   switch (type)
     {
     case RELOAD_FOR_OTHER_ADDRESS:
@@ -5022,10 +5029,12 @@ reload_reg_free_for_value_p (regno, opnum, type, value)
       time1 = opnum * 4 + 2;
       break;
     case RELOAD_FOR_INPUT:
-      time1 = opnum * 4 + 3;
+      /* All RELOAD_FOR_INPUT reloads remain live till just before the
+        instruction is executed.  */
+      time1 = (MAX_RECOG_OPERANDS - 1) * 4 + 3;
       break;
     /* opnum * 4 + 3 < opnum * 4 + 4
-       <= (MAX_RECOG_OPERAND - 1) * 4 + 4 == MAX_RECOG_OPERAND * 4 */
+       <= (MAX_RECOG_OPERANDS - 1) * 4 + 4 == MAX_RECOG_OPERANDS * 4 */
     case RELOAD_FOR_OUTPUT_ADDRESS:
       time1 = MAX_RECOG_OPERANDS * 4 + opnum;
       break;
@@ -5057,10 +5066,13 @@ reload_reg_free_for_value_p (regno, opnum, type, value)
            case RELOAD_FOR_INPUT:
              time2 = reload_opnum[i] * 4 + 3;
              break;
-           /* RELOAD_FOR_OUTPUT and RELOAD_FOR_OUTPUT_ADDRESS reloads
-              for identical operand number conflict with each other, so
-              assign them the same time value.  */
            case RELOAD_FOR_OUTPUT:
+           /* All RELOAD_FOR_OUTPUT reloads become live just after the
+              instruction is executed.  */
+             time2 = MAX_RECOG_OPERANDS * 4;
+             break;
+           /* The first RELOAD_FOR_OUTPUT_ADDRESS reload conflicts with the
+              RELOAD_FOR_OUTPUT reloads, so assign it the same time value.  */
            case RELOAD_FOR_OUTPUT_ADDRESS:
              time2 = MAX_RECOG_OPERANDS * 4 + reload_opnum[i];
              break;