summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2010-01-14 13:40:19 +0300
committerAlexander Monakov <amonakov@gcc.gnu.org>2010-01-14 13:40:19 +0300
commit8ec4d0ada31aee6ee23b4ed7f234171f6639c0dd (patch)
treee323315c55868e5b80a92761215614a104d56236 /gcc
parent2b342bc1fb6df74545e0f33bf8606ac19a66aca9 (diff)
downloadgcc-8ec4d0ada31aee6ee23b4ed7f234171f6639c0dd.tar.gz
re PR rtl-optimization/39453 (ICE : in init_seqno, at sel-sched.c:6433)
2010-01-14 Alexander Monakov <amonakov@ispras.ru> PR rtl-optimization/39453 PR rtl-optimization/42246 * sel-sched-ir.c (considered_for_pipelining_p): Do not test for pipelining_p. (sel_add_loop_preheaders): Add preheader to last_added_blocks. * gcc.dg/pr39453.c: New. * gcc.dg/pr42246.c: New. From-SVN: r155892
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/sel-sched-ir.c5
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/pr39453.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr42246.c36
5 files changed, 73 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fda47c64143..768e12598cc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-14 Alexander Monakov <amonakov@ispras.ru>
+
+ PR rtl-optimization/39453
+ PR rtl-optimization/42246
+ * sel-sched-ir.c (considered_for_pipelining_p): Do not test
+ for pipelining_p.
+ (sel_add_loop_preheaders): Add preheader to last_added_blocks.
+
2010-01-14 Andrey Belevantsev <abel@ispras.ru>
Alexander Monakov <amonakov@ispras.ru>
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index ad1dcb212de..218c04e5bf1 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -5883,7 +5883,7 @@ considered_for_pipelining_p (struct loop *loop)
latch. We can't use header here, because this header could be
just removed preheader and it will give us the wrong region number.
Latch can't be used because it could be in the inner loop too. */
- if (LOOP_MARKED_FOR_PIPELINING_P (loop) && pipelining_p)
+ if (LOOP_MARKED_FOR_PIPELINING_P (loop))
{
int rgn = CONTAINING_RGN (loop->latch->index);
@@ -6032,7 +6032,10 @@ sel_add_loop_preheaders (void)
for (i = 0;
VEC_iterate (basic_block, preheader_blocks, i, bb);
i++)
+ {
+ VEC_safe_push (basic_block, heap, last_added_blocks, bb);
sel_add_bb (bb);
+ }
VEC_free (basic_block, heap, preheader_blocks);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 855b25673f8..af31ac36ba2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2010-01-14 Alexander Monakov <amonakov@ispras.ru>
+ PR rtl-optimization/39453
+ PR rtl-optimization/42246
+ * gcc.dg/pr39453.c: New.
+ * gcc.dg/pr42246.c: New.
+
+2010-01-14 Alexander Monakov <amonakov@ispras.ru>
+
PR middle-end/42245
* gcc.dg/pr42245.c: New.
* gcc.dg/pr42245-2.c: New.
diff --git a/gcc/testsuite/gcc.dg/pr39453.c b/gcc/testsuite/gcc.dg/pr39453.c
new file mode 100644
index 00000000000..66ecc3fa020
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr39453.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops" } */
+
+int foo(int k, int n)
+{
+ int i;
+ for (i = 0; i < n; i += 8) {
+ int j;
+ for (j = 0; j < n; j += 8) {
+ while (k < n) {
+ k += 8;
+ }
+ }
+ }
+ return k;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/pr42246.c b/gcc/testsuite/gcc.dg/pr42246.c
new file mode 100644
index 00000000000..ee17a211210
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr42246.c
@@ -0,0 +1,36 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops" } */
+
+typedef enum
+{
+ empty = 0, pawn = 1, knight = 2, king = 3, bishop = 5, rook = 6, queen = 7
+}
+PIECE;
+extern int p_values[15];
+extern int *last[65];
+int
+Quiesce (int alpha, int beta, int wtm, int ply)
+{
+ register int initial_alpha, value, delta;
+ register int *goodmv, *movep, moves = 0, *sortv, temp;
+ for (movep = last[ply - 1]; movep < last[ply]; movep++)
+ if (p_values[(((*movep) >> 15) & 7) + 7] +
+ p_values[(((*movep) >> 18) & 7) + 7] >= delta)
+ {
+ register int done;
+ register int *end = last[ply - 1] + moves - 1;
+ do
+ {
+ done = 1;
+ movep = last[ply - 1];
+ for (; movep < end; movep++, sortv++)
+ if (*sortv < *(sortv + 1))
+ {
+ *(movep + 1) = temp;
+ done = 0;
+ }
+ }
+ while (!done);
+ }
+}
+