]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/18730 (cppexp.c:1076: error: unrecognizable insn)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Tue, 14 Dec 2004 04:06:08 +0000 (04:06 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 14 Dec 2004 04:06:08 +0000 (04:06 +0000)
PR middle-end/18730
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): When
the first/last insn is a sequence, return the first/last insn of the
sequence.

From-SVN: r92126

gcc/ChangeLog
gcc/emit-rtl.c

index 915137d8144c221e62c9771d7c04fa4a3c501965..5cc4be30cc90990153230c3f61a5b6c25ee6a1ca 100644 (file)
@@ -1,3 +1,10 @@
+2004-12-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR middle-end/18730
+       * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): When
+       the first/last insn is a sequence, return the first/last insn of the
+       sequence.
+
 2004-12-12  Richard Henderson  <rth@redhat.com>
 
         PR target/18932
index a41d00a912012f1789967eac940660216aea0f0b..b674ac2eee7568d64f3483f5e298b44d70e48e9f 100644 (file)
@@ -2888,9 +2888,23 @@ get_last_insn_anywhere ()
 rtx
 get_first_nonnote_insn ()
 {
-  rtx insn;
+  rtx insn = first_insn;
+
+  if (insn)
+    {
+      if (NOTE_P (insn))
+       for (insn = next_insn (insn);
+            insn && NOTE_P (insn);
+            insn = next_insn (insn))
+         continue;
+      else
+       {
+         if (GET_CODE (insn) == INSN
+             && GET_CODE (PATTERN (insn)) == SEQUENCE)
+           insn = XVECEXP (PATTERN (insn), 0, 0);
+       }
+    }
 
-  for (insn = first_insn; insn && NOTE_P (insn); insn = next_insn (insn));
   return insn;
 }
 
@@ -2900,9 +2914,24 @@ get_first_nonnote_insn ()
 rtx
 get_last_nonnote_insn ()
 {
-  rtx insn;
+  rtx insn = last_insn;
+
+  if (insn)
+    {
+      if (NOTE_P (insn))
+       for (insn = previous_insn (insn);
+            insn && NOTE_P (insn);
+            insn = previous_insn (insn))
+         continue;
+      else
+       {
+         if (GET_CODE (insn) == INSN
+             && GET_CODE (PATTERN (insn)) == SEQUENCE)
+           insn = XVECEXP (PATTERN (insn), 0,
+                           XVECLEN (PATTERN (insn), 0) - 1);
+       }
+    }
 
-  for (insn = last_insn; insn && NOTE_P (insn); insn = previous_insn (insn));
   return insn;
 }