From patchwork Fri Jun 11 19:20:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PR43656] skip debug insns in -fsched-pressure Date: Fri, 11 Jun 2010 09:20:53 -0000 From: Alexandre Oliva X-Patchwork-Id: 55351 Message-Id: To: gcc-patches@gcc.gnu.org We didn't take debug insns into account when initializing register pressure computations, but updates would sometimes take reg uses in debug insns into account. This patch fixes this, so that we get the same scheduling. Bootstrapped the compiler, along with the just-posted patch for PR44181, on x86_64-linux-gnu, with the following options: -O2 -g -fschedule-insns -fsched-pressure -funroll-loops -fgraphite-identity for stage2 and stage3 host, and for stage3 libs (also -fcompare-debug) I got build failures on zlib and libada, presumably because of this unusual combination of flags, but no -fcompare-debug errors. Ok to install? for gcc/ChangeLog from Alexandre Oliva PR debug/43656 * haifa-sched.c (setup_insn_reg_pressure_info, update_register_pressure): Reject debug insns. (ready_sort): Don't setup reg pressure for debug insns. (schedule_insn): Don't update reg pressure for debug insns. Index: gcc/haifa-sched.c =================================================================== --- gcc/haifa-sched.c.orig 2010-06-11 10:56:20.000000000 -0300 +++ gcc/haifa-sched.c 2010-06-11 10:56:21.000000000 -0300 @@ -1124,6 +1124,8 @@ setup_insn_reg_pressure_info (rtx insn) struct reg_use_data *use; static int death[N_REG_CLASSES]; + gcc_checking_assert (!DEBUG_INSN_P (insn)); + excess_cost_change = 0; for (i = 0; i < ira_reg_class_cover_size; i++) death[ira_reg_class_cover[i]] = 0; @@ -1500,7 +1502,8 @@ ready_sort (struct ready_list *ready) if (sched_pressure_p) { for (i = 0; i < ready->n_ready; i++) - setup_insn_reg_pressure_info (first[i]); + if (!DEBUG_INSN_P (first[i])) + setup_insn_reg_pressure_info (first[i]); } SCHED_SORT (first, ready->n_ready); } @@ -1564,6 +1567,8 @@ update_register_pressure (rtx insn) struct reg_use_data *use; struct reg_set_data *set; + gcc_checking_assert (!DEBUG_INSN_P (insn)); + for (use = INSN_REG_USE_LIST (insn); use != NULL; use = use->next_insn_use) if (dying_use_p (use) && bitmap_bit_p (curr_reg_live, use->regno)) mark_regno_birth_or_death (use->regno, false); @@ -1684,7 +1689,7 @@ schedule_insn (rtx insn) fputc ('\n', sched_dump); } - if (sched_pressure_p) + if (sched_pressure_p && !DEBUG_INSN_P (insn)) update_reg_and_insn_max_reg_pressure (insn); /* Scheduling instruction should have all its dependencies resolved and