From 2fb5f0da9dff6e7f4e394da90c0edcc333402217 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Thu, 18 Sep 2014 19:14:19 +0000 Subject: [PATCH] re PR debug/63285 (-fcompare-debug scheduler related failure) 2014-09-18 Vladimir Makarov PR debug/63285 * haifa-sched.c (schedule_block): Advance cycle at the end of BB if advance != 0. 2014-09-18 Vladimir Makarov PR debug/63285 * gcc.target/i386/pr63285.c: New test. From-SVN: r215364 --- gcc/ChangeLog | 6 ++++++ gcc/haifa-sched.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr63285.c | 28 +++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr63285.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c55ce46693..de52a05471b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-18 Vladimir Makarov + + PR debug/63285 + * haifa-sched.c (schedule_block): Advance cycle at the end of BB + if advance != 0. + 2014-09-18 Vladimir Makarov PR target/61360 diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index fb92bb21739..cb41cc2b0d2 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -6473,7 +6473,7 @@ schedule_block (basic_block *target_bb, state_t init_state) if (ls.modulo_epilogue) success = true; end_schedule: - if (!ls.first_cycle_insn_p) + if (!ls.first_cycle_insn_p || advance) advance_one_cycle (); perform_replacements_new_cycle (); if (modulo_ii > 0) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index de00b32c291..ba86e0ead7a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-18 Vladimir Makarov + + PR debug/63285 + * gcc.target/i386/pr63285.c: New test. + 2014-09-18 Vladimir Makarov PR target/61360 diff --git a/gcc/testsuite/gcc.target/i386/pr63285.c b/gcc/testsuite/gcc.target/i386/pr63285.c new file mode 100644 index 00000000000..e4df8fb9238 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr63285.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcompare-debug" } */ + +struct S { int a; }; +struct T { int b, c; } a; +long b; +int c, d; +void bar (int, int); +void baz (void *, int); + +void +foo (struct S *x, int y, int z, void *f, int *p, struct T *e) +{ + while (x) + { + baz (f, &d > p); + if (z & 1) + bar (f > (void *) &f, z); + } + if (c) + { + asm ("" : "+m" (a) : "i" (0)); + y--; + } + if (e->b == e->c) + c = y; + y--; +} -- 2.30.2