re PR rtl-optimization/45570 (ICE: in cfg_preds_1, at sel-sched-ir.c:4584)
authorAndrey Belevantsev <abel@ispras.ru>
Thu, 14 Oct 2010 07:56:47 +0000 (11:56 +0400)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Thu, 14 Oct 2010 07:56:47 +0000 (11:56 +0400)
PR rtl-optimization/45570
* sel-sched-ir.c (cfg_preds_1): When walking out of the region, assert
that we are pipelining outer loops.  Allow returning zero predecessors.
* gcc.dg/pr45570.c: New test.

From-SVN: r165454

gcc/ChangeLog
gcc/sel-sched-ir.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr45570.c [new file with mode: 0644]

index 3735ff5..caf71b3 100644 (file)
@@ -1,5 +1,12 @@
 2010-10-14  Andrey Belevantsev  <abel@ispras.ru>
 
+       PR rtl-optimization/45570
+       * sel-sched-ir.c (cfg_preds_1): When walking out of the region,
+       assert that we are pipelining outer loops.  Allow returning
+       zero predecessors.
+
+2010-10-14  Andrey Belevantsev  <abel@ispras.ru>
+
        * sel-sched-ir.c (maybe_tidy_empty_bb): Simplify comment.
        (tidy_control_flow): Tidy vertical space.
        (sel_remove_bb): New variable idx.  Use it to remember the basic
index 34d5f51..f29f711 100644 (file)
@@ -4578,8 +4578,12 @@ cfg_preds_1 (basic_block bb, insn_t **preds, int *n, int *size)
       basic_block pred_bb = e->src;
       insn_t bb_end = BB_END (pred_bb);
 
-      /* ??? This code is not supposed to walk out of a region.  */
-      gcc_assert (in_current_region_p (pred_bb));
+      if (!in_current_region_p (pred_bb))
+       {
+         gcc_assert (flag_sel_sched_pipelining_outer_loops
+                     && current_loop_nest);
+         continue;
+       }
 
       if (sel_bb_empty_p (pred_bb))
        cfg_preds_1 (pred_bb, preds, n, size);
@@ -4592,7 +4596,9 @@ cfg_preds_1 (basic_block bb, insn_t **preds, int *n, int *size)
        }
     }
 
-  gcc_assert (*n != 0);
+  gcc_assert (*n != 0
+             || (flag_sel_sched_pipelining_outer_loops
+                 && current_loop_nest));
 }
 
 /* Find all predecessors of BB and record them in PREDS and their number
index 5dda0f5..98ca284 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-14  Andrey Belevantsev  <abel@ispras.ru>
+
+       PR rtl-optimization/45570
+       * gcc.dg/pr45570.c: New test.
+
 2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/recip-vec-sqrtf-avx.c: New.
diff --git a/gcc/testsuite/gcc.dg/pr45570.c b/gcc/testsuite/gcc.dg/pr45570.c
new file mode 100644 (file)
index 0000000..0b4b367
--- /dev/null
@@ -0,0 +1,58 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "O3 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer" } */
+void
+parser_get_next_char (char c, int qm, char *p)
+{
+  int quote_mode = 0;
+  for (; *p; p++)
+    {
+      if (qm)
+       {
+         if (quote_mode == 0 && *p == '"' && *(p - 1))
+           {
+             quote_mode = 1;
+             continue;
+           }
+         if (quote_mode && *p == '"' && *(p - 1))
+           quote_mode = 0;
+       }
+      if (quote_mode == 0 && *p == c && *(p - 1))
+       break;
+    }
+}
+
+void
+parser_get_next_parameter (char *p)
+{
+  parser_get_next_char (':', 1, p);
+}
+
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "O3 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer" } */
+void
+parser_get_next_char (char c, int qm, char *p)
+{
+  int quote_mode = 0;
+  for (; *p; p++)
+    {
+      if (qm)
+       {
+         if (quote_mode == 0 && *p == '"' && *(p - 1))
+           {
+             quote_mode = 1;
+             continue;
+           }
+         if (quote_mode && *p == '"' && *(p - 1))
+           quote_mode = 0;
+       }
+      if (quote_mode == 0 && *p == c && *(p - 1))
+       break;
+    }
+}
+
+void
+parser_get_next_parameter (char *p)
+{
+  parser_get_next_char (':', 1, p);
+}
+