From: Richard Sandiford Date: Sun, 29 May 2011 17:40:05 +0000 (+0000) Subject: emit-rtl.c (try_split): Use a loop to search for NOTE_INSN_CALL_ARG_LOCATIONs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65f3dedbd51ea84b4db65e481b0cfd81aa183437;p=gcc.git emit-rtl.c (try_split): Use a loop to search for NOTE_INSN_CALL_ARG_LOCATIONs. 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d573409707d..63ba525d08a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-05-29 Richard Sandiford + + * emit-rtl.c (try_split): Use a loop to search for + NOTE_INSN_CALL_ARG_LOCATIONs. + 2011-05-29 Richard Guenther PR tree-optimization/49217 diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 988072b2cbf..f760a1bdc14 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -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; } - } } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ffd768192c7..aa432830495 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-29 Richard Sandiford + + From Ryan Mansfield + * gcc.dg/pr48826.c: New test. + 2011-05-29 Richard Guenther PR tree-optimization/49217 diff --git a/gcc/testsuite/gcc.dg/pr48826.c b/gcc/testsuite/gcc.dg/pr48826.c new file mode 100644 index 00000000000..691f74f4dfa --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr48826.c @@ -0,0 +1,10 @@ +/* { dg-options "-O -g -w" } */ + +void bar (int *); + +void +foo () +{ + int *const pc = __builtin_return_address (0); + bar (pc); +}