public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: "Raúl Porcel" <armin76@gentoo.org>
Subject: [PATCH v2, haifa-sched]: Fix PR56023, -fcompare-debug failure due to sched1 pass on 4.6 branch
Date: Mon, 21 Jan 2013 12:27:00 -0000	[thread overview]
Message-ID: <CAFULd4ZBjrjUF6fdV_VNiV5DhmMS7w524of3DO8qy=6hvdKuyQ@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4ae3+W4O6o8896EsEjEk2pagFu_ryQJRcdg4nRYUKqg5A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

On Sat, Jan 19, 2013 at 8:57 PM, Uros Bizjak <ubizjak@gmail.com> 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  <ubizjak@gmail.com>

        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  <ubizjak@gmail.com>

        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.

[-- Attachment #2: r.diff.txt --]
[-- Type: text/plain, Size: 505 bytes --]

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

  reply	other threads:[~2013-01-21 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19 19:57 [PATCH, " Uros Bizjak
2013-01-21 12:27 ` Uros Bizjak [this message]
2013-01-21 17:37   ` [PATCH v2, " Uros Bizjak
2013-01-21 14:39 ` [PATCH, " Vladimir Makarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFULd4ZBjrjUF6fdV_VNiV5DhmMS7w524of3DO8qy=6hvdKuyQ@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=armin76@gentoo.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).