alpha: Consider barriers when placing nops after sibcalls
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2012 19:31:06 +0000 (19:31 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2012 19:31:06 +0000 (19:31 +0000)
        * config/alpha/alpha.c (alpha_pad_function_end): Consider barriers
        when looking for NOTE_INSN_CALL_ARG_LOCATION.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194484 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 825694e..9f1af89 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-13  Richard Henderson  <rth@redhat.com>
+
+       * config/alpha/alpha.c (alpha_pad_function_end): Consider barriers
+       when looking for NOTE_INSN_CALL_ARG_LOCATION.
+
 2012-12-13  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/53476
index 82135ff..8411218 100644 (file)
@@ -9253,23 +9253,26 @@ alpha_pad_function_end (void)
 
   for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
     {
-      if (! (CALL_P (insn)
-            && (SIBLING_CALL_P (insn)
-                || find_reg_note (insn, REG_NORETURN, NULL_RTX))))
+      if (!CALL_P (insn)
+         || !(SIBLING_CALL_P (insn)
+              || find_reg_note (insn, REG_NORETURN, NULL_RTX)))
         continue;
 
       /* Make sure we do not split a call and its corresponding
         CALL_ARG_LOCATION note.  */
-      if (CALL_P (insn))
+      next = NEXT_INSN (insn);
+      if (next == NULL)
+       continue;
+      if (BARRIER_P (next))
        {
-         next = NEXT_INSN (insn);
-         if (next && NOTE_P (next)
-             && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
-           insn = next;
+         next = NEXT_INSN (next);
+         if (next == NULL)
+           continue;
        }
+      if (NOTE_P (next) && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
+       insn = next;
 
       next = next_active_insn (insn);
-
       if (next)
        {
          rtx pat = PATTERN (next);