sh.c (SCHED_REORDER): Merge macro into ...
authorOleg Endo <olegendo@gcc.gnu.org>
Wed, 11 Apr 2012 16:26:41 +0000 (16:26 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Wed, 11 Apr 2012 16:26:41 +0000 (16:26 +0000)
* config/sh/sh.c (SCHED_REORDER): Merge macro into ...
(ready_reorder): ... this function.

From-SVN: r186327

gcc/ChangeLog
gcc/config/sh/sh.c

index 682a967..c1eab6e 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-11  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       * config/sh/sh.c (SCHED_REORDER): Merge macro into ...
+       (ready_reorder): ... this function.
+
 2012-04-11  Bernd Schmidt  <bernds@codesourcery.com>
 
        * sel-sched.c (sel_global_init): Swap order of sched_rgn_init and
index e7e1945..86f79a1 100644 (file)
@@ -10559,22 +10559,14 @@ swap_reorder (rtx *a, int n)
   a[i + 1] = insn;
 }
 
-#define SCHED_REORDER(READY, N_READY)                                  \
-  do                                                                   \
-    {                                                                  \
-      if ((N_READY) == 2)                                              \
-       swap_reorder (READY, N_READY);                                  \
-      else if ((N_READY) > 2)                                          \
-       qsort (READY, N_READY, sizeof (rtx), rank_for_reorder);         \
-    }                                                                  \
-  while (0)
-
-/* Sort the ready list READY by ascending priority, using the SCHED_REORDER
-   macro.  */
+/* Sort the ready list by ascending priority.  */
 static void
 ready_reorder (rtx *ready, int nready)
 {
-  SCHED_REORDER (ready, nready);
+  if (nready == 2)
+    swap_reorder (ready, nready);
+  else if (nready > 2)
+     qsort (ready, nready, sizeof (rtx), rank_for_reorder);
 }
 
 /* Count life regions of r0 for a block.  */