From 69b45d71f3e8be9fc0d8aeffa4f9113fc78121d7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 20 May 2010 18:34:43 +0200 Subject: re PR debug/44178 (-fcompare-debug failure with -O1 -fgcse -fsched-pressure -funroll-loops -fschedule-insns) PR debug/44178 * haifa-sched.c (initiate_bb_reg_pressure_info): Do not call setup_ref_regs for DEBUG_INSNs. * g++.dg/debug/pr44178.C: New test. From-SVN: r159632 --- gcc/ChangeLog | 6 ++++++ gcc/haifa-sched.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/debug/pr44178.C | 39 ++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/debug/pr44178.C (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f96aa7..769697c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-05-20 Jakub Jelinek + + PR debug/44178 + * haifa-sched.c (initiate_bb_reg_pressure_info): Do not call + setup_ref_regs for DEBUG_INSNs. + 2010-05-20 Jan Hubicka PR middle-end/44197 diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 8bea5e3..f7c087f 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -718,7 +718,7 @@ initiate_bb_reg_pressure_info (basic_block bb) if (current_nr_blocks > 1) FOR_BB_INSNS (bb, insn) - if (INSN_P (insn)) + if (NONDEBUG_INSN_P (insn)) setup_ref_regs (PATTERN (insn)); initiate_reg_pressure_info (df_get_live_in (bb)); #ifdef EH_RETURN_DATA_REGNO diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ddeef01..d50e8ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-05-20 Jakub Jelinek + + PR debug/44178 + * g++.dg/debug/pr44178.C: New test. + 2010-05-20 Changpeng Fang PR middle-end/44185 diff --git a/gcc/testsuite/g++.dg/debug/pr44178.C b/gcc/testsuite/g++.dg/debug/pr44178.C new file mode 100644 index 0000000..2df5669 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr44178.C @@ -0,0 +1,39 @@ +// PR debug/44178 +// { dg-do compile } +// { dg-options "-funroll-loops -fcompare-debug" { target i?86-*-* x86_64-*-* } } +// { dg-options "-fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" { target i?86-*-* x86_64-*-* } } + +struct A +{ + A (); + A (const A &) {} + A &operator = (const A &); +}; + +struct B +{ + int u1; + A u2; + int u3; + int i; +}; + +B f1 (int *); +B f2 (int, int, int, int); +B f3 (B *, B *); + +B +f4 (int x, int y, int z) +{ + B b1, b2; + for (int i = x; i > 0; i--) + for (int j = y; j > 0; j--) + { + int k; + f1 (&k); + b2 = f2 (i, 0, 0, z); + if (b2.i) return b2; + f3 (&b1, &b2); + } + return b1; +} -- cgit v1.1