]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/9258 (ICE in compensate_edge, at reg-stack.c:2589)
authorJan Hubicka <jh@suse.cz>
Sat, 25 Jan 2003 14:42:49 +0000 (15:42 +0100)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sat, 25 Jan 2003 14:42:49 +0000 (14:42 +0000)
        PR fortran/9258
        * global.c (struct allocno): Add no_stack_reg.
        (global_conflicts): Set no_stack_reg.
        (find_reg): Use it.

From-SVN: r61770

gcc/ChangeLog
gcc/global.c
gcc/testsuite/g77.dg/pr9258.f [new file with mode: 0644]

index 04f8869e021e0c76a27aee7ec8a8bcd55ef06a13..a443a1813062177a22f3a8cc23969ef59a39ce5a 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-25  Jan Hubicka  <jh@suse.cz>
+
+       PR fortran/9258
+        * global.c (struct allocno): Add no_stack_reg. 
+        (global_conflicts): Set no_stack_reg.
+        (find_reg): Use it.
+       
 2003-01-24  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        * doc/passes.texi: Fix typo.
index 0d9618c27b72c73337ce91ace05b7ea407012896..383f6c4943c965c459eed5ae44466a5b9d7cd990 100644 (file)
@@ -130,6 +130,11 @@ struct allocno
   /* Set of hard registers that some later allocno has a preference for.  */
 
   HARD_REG_SET regs_someone_prefers;
+
+#ifdef STACK_REGS
+  /* Set to true if allocno can't be allocated in the stack register.  */
+  bool no_stack_reg;
+#endif
 };
 
 static struct allocno *allocno;
@@ -717,8 +722,14 @@ global_conflicts ()
            if (e->flags & EDGE_ABNORMAL)
              break;
          if (e != NULL)
-           for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
-             record_one_conflict (ax);
+            {
+              EXECUTE_IF_SET_IN_ALLOCNO_SET (allocnos_live, ax,
+                {
+                  allocno[ax].no_stack_reg = 1;
+                });
+              for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
+                record_one_conflict (ax);
+            }
        }
 #endif
       }
@@ -1216,6 +1227,10 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
                    && (TEST_HARD_REG_BIT
                        (reg_class_contents[(int) CLASS_CANNOT_CHANGE_MODE],
                         regno)))
+#endif
+#ifdef STACK_REGS
+              && (!allocno[num].no_stack_reg
+                  || regno < FIRST_STACK_REG || regno > LAST_STACK_REG)
 #endif
              )
            {
diff --git a/gcc/testsuite/g77.dg/pr9258.f b/gcc/testsuite/g77.dg/pr9258.f
new file mode 100644 (file)
index 0000000..1bae920
--- /dev/null
@@ -0,0 +1,18 @@
+C Test case for PR fortran/9258
+C Origin: kmccarty@Princeton.EDU
+C
+C { dg-do compile }
+      SUBROUTINE FOO (B)
+
+ 10   CALL BAR(A)
+      ASSIGN 20 TO M
+      IF(100.LT.A) GOTO 10
+      GOTO 40
+C
+ 20   IF(B.LT.ABS(A)) GOTO 10
+      ASSIGN 30 TO M
+      GOTO 40
+C
+ 30   ASSIGN 10 TO M
+ 40   GOTO M,(10,20,30)
+      END