]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop.c (mark_loop_jump): Handle LO_SUM.
authorJeffrey A Law <law@cygnus.com>
Mon, 15 Feb 1999 10:36:05 +0000 (10:36 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 15 Feb 1999 10:36:05 +0000 (03:36 -0700)
        * loop.c (mark_loop_jump): Handle LO_SUM.  If we encounter something
        we do not understand, mark the loop and containing loops as invalid.

From-SVN: r25213

gcc/ChangeLog
gcc/loop.c

index 4ae0e99384138132a786d5d1601ec79d408e956f..61fbb22ed1873895a648698cb7c3fb9e7d69d713 100644 (file)
@@ -1,3 +1,8 @@
+Mon Feb 15 11:33:51 1999  Jeffrey A Law  (law@cygnus.com)
+
+       * loop.c (mark_loop_jump): Handle LO_SUM.  If we encounter something
+       we do not understand, mark the loop and containing loops as invalid.
+
 Sun Feb 14 23:05:34 1999  Jeffrey A Law  (law@cygnus.com)
 
        Tue Feb  9 21:14:03 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
index cfa3f60ef20c5d300bed252c7376532d84b356ac..04c8083728471df61bcdaa066579381f8bf1288e 100644 (file)
@@ -2701,6 +2701,11 @@ mark_loop_jump (x, loop_num)
       mark_loop_jump (XEXP (x, 1), loop_num);
       return;
 
+    case LO_SUM:
+      /* This may refer to a LABEL_REF or SYMBOL_REF.  */
+      mark_loop_jump (XEXP (x, 1), loop_num);
+      return;
+
     case SIGN_EXTEND:
     case ZERO_EXTEND:
       mark_loop_jump (XEXP (x, 0), loop_num);
@@ -2788,21 +2793,21 @@ mark_loop_jump (x, loop_num)
       return;
 
     default:
-      /* Treat anything else (such as a symbol_ref)
-        as a branch out of this loop, but not into any loop.  */
-
+      /* Strictly speaking this is not a jump into the loop, only a possible
+        jump out of the loop.  However, we have no way to link the destination
+        of this jump onto the list of exit labels.  To be safe we mark this
+        loop and any containing loops as invalid.  */
       if (loop_num != -1)
        {
-#ifdef HAIFA
-         LABEL_OUTSIDE_LOOP_P (x) = 1;
-         LABEL_NEXTREF (x) = loop_number_exit_labels[loop_num];
-#endif  /* HAIFA */
-
-         loop_number_exit_labels[loop_num] = x;
-
          for (outer_loop = loop_num; outer_loop != -1;
               outer_loop = loop_outer_loop[outer_loop])
-           loop_number_exit_count[outer_loop]++;
+           {
+             if (loop_dump_stream && ! loop_invalid[outer_loop])
+               fprintf (loop_dump_stream,
+                        "\nLoop at %d ignored due to unknown exit jump.\n",
+                        INSN_UID (loop_number_loop_starts[outer_loop]));
+             loop_invalid[outer_loop] = 1;
+           }
        }
       return;
     }