re PR rtl-optimization/46755 (ICE: in calc_dfs_tree, at dominance.c:395 with -O)
authorSteven Bosscher <steven@gcc.gnu.org>
Tue, 21 Dec 2010 14:55:41 +0000 (14:55 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Tue, 21 Dec 2010 14:55:41 +0000 (14:55 +0000)
gcc/
PR rtl-optimization/46755
* ira.c (ira): If some dead edges were removed, find and delete
any blocks that might have become unreachable.

testsuite/
PR rtl-optimization/46755
* gfortran.dg/pr46755.f: New test

From-SVN: r168118

gcc/ChangeLog
gcc/ira.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr46755.f [new file with mode: 0644]

index 2b47e8e..bfdad2f 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-21  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR rtl-optimization/46755
+       * ira.c (ira): If some dead edges were removed, find and delete
+       any blocks that might have become unreachable.
+
 2010-12-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/47008
index 6db1fba..5f27fc2 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3158,7 +3158,8 @@ ira (FILE *f)
        {
          timevar_push (TV_JUMP);
          rebuild_jump_labels (get_insns ());
-         purge_all_dead_edges ();
+         if (purge_all_dead_edges ())
+           delete_unreachable_blocks ();
          timevar_pop (TV_JUMP);
        }
     }
index 3a66f1c..d66df22 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-21  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR rtl-optimization/46755
+       * gfortran.dg/pr46755.f: New test.
+
 2010-12-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/47008
diff --git a/gcc/testsuite/gfortran.dg/pr46755.f b/gcc/testsuite/gfortran.dg/pr46755.f
new file mode 100644 (file)
index 0000000..ff764a7
--- /dev/null
@@ -0,0 +1,23 @@
+C { dg-do compile }
+C { dg-options "-O" }
+      IMPLICIT NONE
+      INTEGER I640,I760,I800
+      INTEGER I,ITER,ITMX,LENCM
+      LOGICAL QDISK,QDW
+      ASSIGN 801 TO I800
+      GOTO I800
+ 801  CONTINUE
+      ASSIGN 761 TO I760
+ 761  CONTINUE
+      DO I=1,LENCM
+      ENDDO
+      DO WHILE(ITER.LT.ITMX)
+         IF(QDW) THEN
+            ASSIGN 641 to I640
+            GOTO I760
+ 641        CONTINUE
+         ENDIF
+      ENDDO
+      RETURN
+      END
+