aboutsummaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2011-01-25 22:27:51 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2011-01-25 22:27:51 +0000
commit9bdbdcef9a8c9615c7d7ccb69bc5110b3c04a78b (patch)
tree6a6de1f5b3d7fc3e205bef331cb55788bda819b7 /gcc/haifa-sched.c
parentb28641995ca556027897488809a2c5e4a4408298 (diff)
downloadgcc-9bdbdcef9a8c9615c7d7ccb69bc5110b3c04a78b.zip
gcc-9bdbdcef9a8c9615c7d7ccb69bc5110b3c04a78b.tar.gz
gcc-9bdbdcef9a8c9615c7d7ccb69bc5110b3c04a78b.tar.bz2
re PR debug/45136 (-fcompare-debug failure with -Os -fschedule-insns)
PR debug/45136 PR debug/45130 * haifa-sched.c (get_ebb_head_tail): Move notes across boundary debug insns. (no_real_insns_p, schedule_block, set_priorities): Drop special treatment of boundary debug insns. * sched-deps.c (sd_init_insn, sd_finish_insn): Don't mark debug insns. * sched-ebb.c (schedule_ebbs): Don't skip debug insns. * sched-int.h (DEBUG_INSN_SCHED_P): Remove. (BOUNDARY_DEBUG_INSN_P): Likewise. (SCHEDULE_DEBUG_INSN_P): Likewise. * sched-rgn.c (init_ready_list): Drop special treatment of boundary debug insns. * final.c (rest_of_clean-state): Clear notes' BB. From-SVN: r169260
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c58
1 files changed, 52 insertions, 6 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index bd3b84c..68499f1 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1900,8 +1900,30 @@ get_ebb_head_tail (basic_block beg, basic_block end, rtx *headp, rtx *tailp)
beg_head = NEXT_INSN (beg_head);
while (beg_head != beg_tail)
- if (NOTE_P (beg_head) || BOUNDARY_DEBUG_INSN_P (beg_head))
+ if (NOTE_P (beg_head))
beg_head = NEXT_INSN (beg_head);
+ else if (DEBUG_INSN_P (beg_head))
+ {
+ rtx note, next;
+
+ for (note = NEXT_INSN (beg_head);
+ note != beg_tail;
+ note = next)
+ {
+ next = NEXT_INSN (note);
+ if (NOTE_P (note))
+ {
+ if (sched_verbose >= 9)
+ fprintf (sched_dump, "reorder %i\n", INSN_UID (note));
+
+ reorder_insns_nobb (note, note, PREV_INSN (beg_head));
+ }
+ else if (!DEBUG_INSN_P (note))
+ break;
+ }
+
+ break;
+ }
else
break;
@@ -1913,8 +1935,33 @@ get_ebb_head_tail (basic_block beg, basic_block end, rtx *headp, rtx *tailp)
end_head = NEXT_INSN (end_head);
while (end_head != end_tail)
- if (NOTE_P (end_tail) || BOUNDARY_DEBUG_INSN_P (end_tail))
+ if (NOTE_P (end_tail))
end_tail = PREV_INSN (end_tail);
+ else if (DEBUG_INSN_P (end_tail))
+ {
+ rtx note, prev;
+
+ for (note = PREV_INSN (end_tail);
+ note != end_head;
+ note = prev)
+ {
+ prev = PREV_INSN (note);
+ if (NOTE_P (note))
+ {
+ if (sched_verbose >= 9)
+ fprintf (sched_dump, "reorder %i\n", INSN_UID (note));
+
+ reorder_insns_nobb (note, note, end_tail);
+
+ if (end_tail == BB_END (end))
+ df_insn_change_bb (note, NULL);
+ }
+ else if (!DEBUG_INSN_P (note))
+ break;
+ }
+
+ break;
+ }
else
break;
@@ -1928,8 +1975,7 @@ no_real_insns_p (const_rtx head, const_rtx tail)
{
while (head != NEXT_INSN (tail))
{
- if (!NOTE_P (head) && !LABEL_P (head)
- && !BOUNDARY_DEBUG_INSN_P (head))
+ if (!NOTE_P (head) && !LABEL_P (head))
return 0;
head = NEXT_INSN (head);
}
@@ -2812,7 +2858,7 @@ schedule_block (basic_block *target_bb)
last_scheduled_insn = prev_head;
gcc_assert ((NOTE_P (last_scheduled_insn)
- || BOUNDARY_DEBUG_INSN_P (last_scheduled_insn))
+ || DEBUG_INSN_P (last_scheduled_insn))
&& BLOCK_FOR_INSN (last_scheduled_insn) == *target_bb);
/* Initialize INSN_QUEUE. Q_SIZE is the total number of insns in the
@@ -3319,7 +3365,7 @@ set_priorities (rtx head, rtx tail)
current_sched_info->sched_max_insns_priority;
rtx prev_head;
- if (head == tail && (! INSN_P (head) || BOUNDARY_DEBUG_INSN_P (head)))
+ if (head == tail && ! INSN_P (head))
gcc_unreachable ();
n_insn = 0;