2013-11-04 Wei Mi <wmi@google.com>
authorwmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Nov 2013 21:45:05 +0000 (21:45 +0000)
committerwmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Nov 2013 21:45:05 +0000 (21:45 +0000)
        * sched-rgn.c (add_branch_dependences): Keep insns in
        a SCHED_GROUP at the end of BB to remain their location.

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

gcc/ChangeLog
gcc/sched-rgn.c

index 895da5a..4d08af4 100644 (file)
@@ -1,5 +1,10 @@
 2013-11-04  Wei Mi  <wmi@google.com>
 
+       * sched-rgn.c (add_branch_dependences): Keep insns in
+       a SCHED_GROUP at the end of BB to remain their location.
+
+2013-11-04  Wei Mi  <wmi@google.com>
+
        * gcc/config/i386/i386.c (memory_address_length): Extract a part
        of code to rip_relative_addr_p.
        (rip_relative_addr_p): New Function.
index bf9b10d..73a236b 100644 (file)
@@ -2443,6 +2443,8 @@ add_branch_dependences (rtx head, rtx tail)
      cc0 setters remain at the end because they can't be moved away from
      their cc0 user.
 
+     Predecessors of SCHED_GROUP_P instructions at the end remain at the end.
+
      COND_EXEC insns cannot be moved past a branch (see e.g. PR17808).
 
      Insns setting TARGET_CLASS_LIKELY_SPILLED_P registers (usually return
@@ -2465,7 +2467,8 @@ add_branch_dependences (rtx head, rtx tail)
 #endif
                 || (!reload_completed
                     && sets_likely_spilled (PATTERN (insn)))))
-        || NOTE_P (insn))
+        || NOTE_P (insn)
+        || (last != 0 && SCHED_GROUP_P (last)))
     {
       if (!NOTE_P (insn))
        {