public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/61801] sched2 miscompiles syscall sequence with -g
Date: Wed, 16 Jul 2014 09:03:00 -0000	[thread overview]
Message-ID: <bug-61801-4-fTUl91TvIz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61801-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-07-16
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
The following fixes it as well, in the scheduler.

Index: gcc/sched-deps.c
===================================================================
--- gcc/sched-deps.c    (revision 212580)
+++ gcc/sched-deps.c    (working copy)
@@ -2713,7 +2713,8 @@ sched_analyze_2 (struct deps_desc *deps,
       break;

     case PREFETCH:
-      if (PREFETCH_SCHEDULE_BARRIER_P (x))
+      if (PREFETCH_SCHEDULE_BARRIER_P (x)
+         && !DEBUG_INSN_P (insn))
        reg_pending_barrier = TRUE_BARRIER;
       /* Prefetch insn contains addresses only.  So if the prefetch
         address has no registers, there will be no dependencies on
@@ -2750,7 +2751,8 @@ sched_analyze_2 (struct deps_desc *deps,
           Consider for instance a volatile asm that changes the fpu rounding
           mode.  An insn should not be moved across this even if it only uses
           pseudo-regs because it might give an incorrectly rounded result.  */
-       if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
+       if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
+           && !DEBUG_INSN_P (insn))
          reg_pending_barrier = TRUE_BARRIER;

        /* For all ASM_OPERANDS, we must traverse the vector of input operands.

we then have

;;   --- Region Dependences --- b 12 bb 0 
;;      insn  code    bb   dep  prio  cost   reservation
;;      ----  ----    --   ---  ----  ----   -----------
;;      239    90    12     1     5     1  
athlon-direct,athlon-agu,athlon-store       : 127 123nm 216n 240 
...
;;      122    -1    12     3     0     0   nothing     : 124 123nm 
;;      216    90    12     1     5     3   athlon-direct,athlon-load   : 127
123nm 243 

so the false forward dependence of the store to the debug-insn is gone
and instead a proper dependence on the load is there.

Testing the fix.


  parent reply	other threads:[~2014-07-16  9:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 14:46 [Bug rtl-optimization/61801] New: " rguenth at gcc dot gnu.org
2014-07-15  9:35 ` [Bug rtl-optimization/61801] " rguenth at gcc dot gnu.org
2014-07-15  9:42 ` rguenth at gcc dot gnu.org
2014-07-15  9:47 ` rguenth at gcc dot gnu.org
2014-07-15 10:40 ` rguenth at gcc dot gnu.org
2014-07-15 14:37 ` rguenth at gcc dot gnu.org
2014-07-15 18:59 ` jakub at gcc dot gnu.org
2014-07-16  8:29 ` rguenth at gcc dot gnu.org
2014-07-16  9:03 ` rguenth at gcc dot gnu.org [this message]
2014-07-17  7:48 ` rguenth at gcc dot gnu.org
2014-07-17  7:49 ` rguenth at gcc dot gnu.org
2014-07-17  7:50 ` rguenth at gcc dot gnu.org
2014-07-17  7:50 ` rguenth at gcc dot gnu.org
2014-07-25  9:33 ` rguenth at gcc dot gnu.org
2014-07-26 14:44 ` trippels at gcc dot gnu.org
2014-07-28  7:54 ` rguenth at gcc dot gnu.org
2014-07-28  7:55 ` rguenth at gcc dot gnu.org
2014-07-28  7:59 ` rguenth at gcc dot gnu.org
2014-07-28  9:02 ` rguenth at gcc dot gnu.org
2014-07-28  9:02 ` rguenth at gcc dot gnu.org
2014-07-28  9:03 ` rguenth at gcc dot gnu.org
2014-08-06  8:41 ` jakub at gcc dot gnu.org
2014-08-06  8:44 ` jakub at gcc dot gnu.org
2014-08-06  8:50 ` jakub at gcc dot gnu.org

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=bug-61801-4-fTUl91TvIz@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).