cfgloop.c (flow_loops_find): Fix handling of abnormal edges.
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
Thu, 16 Jan 2003 15:49:20 +0000 (16:49 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Thu, 16 Jan 2003 15:49:20 +0000 (15:49 +0000)
2003-01-16  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>

* cfgloop.c (flow_loops_find): Fix handling of abnormal edges.

From-SVN: r61393

gcc/ChangeLog
gcc/cfgloop.c

index 8dedbee91183c7c056dad2151f6596e6e03f22bb..fa920142e96ad3f7234f6830b05061ac19cca59f 100644 (file)
@@ -1,3 +1,7 @@
+2003-01-16  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+
+       * cfgloop.c (flow_loops_find): Fix handling of abnormal edges.
+
 2003-01-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * dbxout.c (lastfile, cwd): Fix `unused' warning.
index da958c22324db34bfd655b7fa17e90289a5c0790..b93302e82c85c9b7a4e1e6ec3ede78e6d8a78cc5 100644 (file)
@@ -804,19 +804,20 @@ flow_loops_find (loops, flags)
      
       header->loop_depth = 0;
 
+      /* If we have an abnormal predecessor, do not consider the
+        loop (not worth the problems).  */
+      for (e = header->pred; e; e = e->pred_next)
+       if (e->flags & EDGE_ABNORMAL)
+         break;
+      if (e)
+       continue;
+
       for (e = header->pred; e; e = e->pred_next)
        {
          basic_block latch = e->src;
 
          if (e->flags & EDGE_ABNORMAL)
-           {
-             if (more_latches)
-               {
-                 RESET_BIT (headers, header->index);
-                 num_loops--;
-               }
-             break;
-           }
+           abort ();
 
          /* Look for back edges where a predecessor is dominated
             by this block.  A natural loop has a single entry