re PR rtl-optimization/14838 (ICE when building with -O2 -g)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Tue, 23 Nov 2004 02:15:16 +0000 (02:15 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 23 Nov 2004 02:15:16 +0000 (02:15 +0000)
PR rtl-optimization/14838
* emit-rtl.c (get_first_nonnote_insn): Don't assume first insn is a
note.
(get_last_nonnote_insn): Don't assume last insn is a note.

From-SVN: r91065

gcc/ChangeLog
gcc/emit-rtl.c

index 4604a925b69a4f6ceffba7b6053074034ecc0a82..b4126fde6a5d0a89b12e71ea599fc4e626abdcdc 100644 (file)
@@ -1,3 +1,10 @@
+2004-11-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR rtl-optimization/14838
+       * emit-rtl.c (get_first_nonnote_insn): Don't assume first insn is a
+       note.
+       (get_last_nonnote_insn): Don't assume last insn is a note.
+
 2004-11-22  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (nondestructive_fold_binary_to_constant): Rename
index 051dd152d15ab9c8b64f17d81ebbcb9ed0fc420e..5f2d8b262a3cf9ba93959293ebef3ae3dd501b30 100644 (file)
@@ -2738,15 +2738,9 @@ get_last_insn_anywhere (void)
 rtx
 get_first_nonnote_insn (void)
 {
-  rtx insn = first_insn;
-
-  while (insn)
-    {
-      insn = next_insn (insn);
-      if (insn == 0 || !NOTE_P (insn))
-       break;
-    }
+  rtx insn;
 
+  for (insn = first_insn; insn && NOTE_P (insn); insn = next_insn (insn));
   return insn;
 }
 
@@ -2756,15 +2750,9 @@ get_first_nonnote_insn (void)
 rtx
 get_last_nonnote_insn (void)
 {
-  rtx insn = last_insn;
-
-  while (insn)
-    {
-      insn = previous_insn (insn);
-      if (insn == 0 || !NOTE_P (insn))
-       break;
-    }
+  rtx insn;
 
+  for (insn = last_insn; insn && NOTE_P (insn); insn = previous_insn (insn));
   return insn;
 }