On Sat, Jan 19, 2013 at 8:57 PM, Uros Bizjak <[email protected]> wrote:
> We should not update ticks of instructions, dependent on debug
> instruction. Without the patch, the scheduling order depends on the
> presence of debug instructions and leads to -fcompare-debug failures.
Attached patch refines previous patch to reject only cases where
non-debug insns depend on debug instructions. We can still fix
inter-ticks of dependent debug insns, without affecting emitted
real-insn sequences.
2012-01-21 Uros Bizjak <[email protected]>
PR rtl-optimization/56023
* haifa-sched.c (fix_inter_tick): Do not update ticks of non-debug
instructions, dependent on debug instruction.
testsuite/ChangeLog:
2012-01-21 Uros Bizjak <[email protected]>
PR rtl-optimization/56023
* gcc.dg/pr56023.c: New test.
Re-tested on 4.6 branch on alpha-linux-gnu, where it fixes the
bootstrap failure and on x86_64-pc-linux-gnu {,-m32}.
The patch should be applied to 4.7 and 4.8 branches as well. Patch was
also re-tested on mainline x86_64-pc-linux-gnu {,-m32}.
OK for 4.6, 4.7 and mainline?
Uros.
Index: haifa-sched.c
===================================================================
--- haifa-sched.c (revision 195330)
+++ haifa-sched.c (working copy)
@@ -3686,9 +3686,11 @@ fix_inter_tick (rtx head, rtx tail)
FOR_EACH_DEP (head, SD_LIST_RES_FORW, sd_it, dep)
{
- rtx next;
+ rtx next = DEP_CON (dep);
- next = DEP_CON (dep);
+ if (DEBUG_INSN_P (head) && !DEBUG_INSN_P (next))
+ continue;
+
tick = INSN_TICK (next);
if (tick != INVALID_TICK