emit-rtl.c (try_split): Use a loop to search for NOTE_INSN_CALL_ARG_LOCATIONs.
authorRichard Sandiford <rdsandiford@googlemail.com>
Sun, 29 May 2011 17:40:05 +0000 (17:40 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 29 May 2011 17:40:05 +0000 (17:40 +0000)
gcc/
* emit-rtl.c (try_split): Use a loop to search for
NOTE_INSN_CALL_ARG_LOCATIONs.

gcc/testsuite/
From Ryan Mansfield
* gcc.dg/pr48826.c: New test.

From-SVN: r174401

gcc/ChangeLog
gcc/emit-rtl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr48826.c [new file with mode: 0644]

index d573409707da9e6d24a8b5526335070886ffeadf..63ba525d08a43c92a7e96b2833f9730263d1017b 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-29  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * emit-rtl.c (try_split): Use a loop to search for
+       NOTE_INSN_CALL_ARG_LOCATIONs.
+
 2011-05-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/49217
index 988072b2cbfaf1898b13f6774aa3d0a4731a7868..f760a1bdc1484230c77afbd097c8aa18e30ecd9d 100644 (file)
@@ -3494,16 +3494,15 @@ try_split (rtx pat, rtx trial, int last)
               we must move any following NOTE_INSN_CALL_ARG_LOCATION note
               so that it comes immediately after the new call.  */
            if (NEXT_INSN (insn))
-             {
-               next = NEXT_INSN (trial);
-               if (next
-                   && NOTE_P (next)
-                   && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
+             for (next = NEXT_INSN (trial);
+                  next && NOTE_P (next);
+                  next = NEXT_INSN (next))
+               if (NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
                  {
                    remove_insn (next);
                    add_insn_after (next, insn, NULL);
+                   break;
                  }
-             }
          }
     }
 
index ffd768192c77c290baf8cc89f1a3cbbeaba0b810..aa432830495dfed339d3dd37b5d76b7a52ed53ee 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-29  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       From Ryan Mansfield
+       * gcc.dg/pr48826.c: New test.
+
 2011-05-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/49217
diff --git a/gcc/testsuite/gcc.dg/pr48826.c b/gcc/testsuite/gcc.dg/pr48826.c
new file mode 100644 (file)
index 0000000..691f74f
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-options "-O -g -w" } */
+
+void bar (int *);
+
+void
+foo ()
+{
+  int *const pc = __builtin_return_address (0);
+  bar (pc);
+}