From d3b82ee3730b2ccb5da81fdcc27180959b096c52 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sat, 6 Feb 2016 05:40:21 -0200 Subject: [PR69634] fix debug_insn-inconsistent REG_N_CALLS_CROSSED The testcase has a debug insn referencing a pseudo right before an insn that modifies the pseudo. Without debug insns, REG_N_CALLS_CROSSED was zero for that pseudo, so sched_analyze_reg added a dep between the pseudo setter and an earlier (lib)call. With debug insns, we miscomputed REG_N_CALLS_CROSSED as nonzero because of the debug insn, and then no dep was added between the two insns. This was enough to change sched1's decisions about where to place the pseudo setter. REG_N_CALLS_CROSSED is computed by both regstat_bb_compute_ri and regstat_bb_compute_calls_crossed, but although the former skipped debug insns, the latter didn't. Fixing this inconsistency was enough to fix the -fcompare-debug error. for gcc/ChangeLog PR target/69634 * regstat.c (regstat_bb_compute_calls_crossed): Disregard debug insns. for gcc/testsuite/ChangeLog PR target/69634 * gcc.dg/pr69634.c: New. --- gcc/regstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/regstat.c') diff --git a/gcc/regstat.c b/gcc/regstat.c index af5e475ddda..c05b69f6c1a 100644 --- a/gcc/regstat.c +++ b/gcc/regstat.c @@ -444,7 +444,7 @@ regstat_bb_compute_calls_crossed (unsigned int bb_index, bitmap live) struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn); unsigned int regno; - if (!INSN_P (insn)) + if (!NONDEBUG_INSN_P (insn)) continue; /* Process the defs. */ -- cgit v1.2.1