re PR debug/66691 (ICE on valid code at -O3 with -g enabled in simplify_subreg, at...
[gcc.git] / gcc / modulo-sched.c
index 5a44cbf97af069f56dbd8f40a04ca0d68facd597..60b39f81d180f13f77462956c0fae446d3b4bf39 100644 (file)
@@ -1,5 +1,5 @@
 /* Swing Modulo Scheduling implementation.
-   Copyright (C) 2004-2014 Free Software Foundation, Inc.
+   Copyright (C) 2004-2015 Free Software Foundation, Inc.
    Contributed by Ayal Zaks and Mustafa Hagog <zaks,mustafa@il.ibm.com>
 
 This file is part of GCC.
@@ -28,27 +28,42 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "hard-reg-set.h"
 #include "regs.h"
-#include "hashtab.h"
-#include "hash-set.h"
-#include "vec.h"
-#include "machmode.h"
-#include "input.h"
 #include "function.h"
+#include "profile.h"
 #include "flags.h"
 #include "insn-config.h"
 #include "insn-attr.h"
 #include "except.h"
 #include "recog.h"
+#include "dominance.h"
+#include "cfg.h"
+#include "cfgrtl.h"
+#include "predict.h"
+#include "basic-block.h"
 #include "sched-int.h"
 #include "target.h"
 #include "cfgloop.h"
+#include "alias.h"
+#include "symtab.h"
+#include "tree.h"
+#include "insn-codes.h"
+#include "optabs.h"
+#include "expmed.h"
+#include "dojump.h"
+#include "explow.h"
+#include "calls.h"
+#include "emit-rtl.h"
+#include "varasm.h"
+#include "stmt.h"
 #include "expr.h"
 #include "params.h"
 #include "gcov-io.h"
+#include "sbitmap.h"
+#include "df.h"
 #include "ddg.h"
 #include "tree-pass.h"
 #include "dbgcnt.h"
-#include "df.h"
+#include "loop-unroll.h"
 
 #ifdef INSN_SCHEDULING
 
@@ -764,8 +779,7 @@ schedule_reg_moves (partial_schedule_ptr ps)
          move->old_reg = old_reg;
          move->new_reg = gen_reg_rtx (GET_MODE (prev_reg));
          move->num_consecutive_stages = distances[0] && distances[1] ? 2 : 1;
-         move->insn = as_a <rtx_insn *> (gen_move_insn (move->new_reg,
-                                                        copy_rtx (prev_reg)));
+         move->insn = gen_move_insn (move->new_reg, copy_rtx (prev_reg));
          bitmap_clear (move->uses);
 
          prev_reg = move->new_reg;
@@ -1456,15 +1470,15 @@ sms_schedule (void)
              if (profile_info && flag_branch_probabilities)
                {
                  fprintf (dump_file, "SMS loop-count ");
-                 fprintf (dump_file, "%"PRId64,
+                 fprintf (dump_file, "%" PRId64,
                           (int64_t) bb->count);
                  fprintf (dump_file, "\n");
                   fprintf (dump_file, "SMS trip-count ");
-                  fprintf (dump_file, "%"PRId64,
+                  fprintf (dump_file, "%" PRId64,
                            (int64_t) trip_count);
                   fprintf (dump_file, "\n");
                  fprintf (dump_file, "SMS profile-sum-max ");
-                 fprintf (dump_file, "%"PRId64,
+                 fprintf (dump_file, "%" PRId64,
                           (int64_t) profile_info->sum_max);
                  fprintf (dump_file, "\n");
                }
@@ -1578,11 +1592,11 @@ sms_schedule (void)
          if (profile_info && flag_branch_probabilities)
            {
              fprintf (dump_file, "SMS loop-count ");
-             fprintf (dump_file, "%"PRId64,
+             fprintf (dump_file, "%" PRId64,
                       (int64_t) bb->count);
              fprintf (dump_file, "\n");
              fprintf (dump_file, "SMS profile-sum-max ");
-             fprintf (dump_file, "%"PRId64,
+             fprintf (dump_file, "%" PRId64,
                       (int64_t) profile_info->sum_max);
              fprintf (dump_file, "\n");
            }
@@ -1609,7 +1623,7 @@ sms_schedule (void)
       if (dump_file && count_init)
         {
           fprintf (dump_file, "SMS const-doloop ");
-          fprintf (dump_file, "%"PRId64,
+          fprintf (dump_file, "%" PRId64,
                     loop_count);
           fprintf (dump_file, "\n");
         }
@@ -1670,9 +1684,9 @@ sms_schedule (void)
                  fprintf (dump_file, "SMS failed... \n");
                  fprintf (dump_file, "SMS sched-failed (stage-count=%d,"
                           " loop-count=", stage_count);
-                 fprintf (dump_file, "%"PRId64, loop_count);
+                 fprintf (dump_file, "%" PRId64, loop_count);
                  fprintf (dump_file, ", trip-count=");
-                 fprintf (dump_file, "%"PRId64, trip_count);
+                 fprintf (dump_file, "%" PRId64, trip_count);
                  fprintf (dump_file, ")\n");
                }
              break;
@@ -1992,9 +2006,7 @@ get_sched_window (partial_schedule_ptr ps, ddg_node_ptr u_node,
      node close to its successors.  */
   if (pss_not_empty && count_succs >= count_preds)
     {
-      int tmp = end;
-      end = start;
-      start = tmp;
+      std::swap (start, end);
       step = -1;
     }
 
@@ -2177,7 +2189,7 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order)
        {
          int u = nodes_order[i];
          ddg_node_ptr u_node = &ps->g->nodes[u];
-         rtx insn = u_node->insn;
+         rtx_insn *insn = u_node->insn;
 
          if (!NONDEBUG_INSN_P (insn))
            {