public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/41535]  New: Broken var location info after scheduling
@ 2009-10-01 15:58 krebbel at gcc dot gnu dot org
  2009-10-01 15:58 ` [Bug middle-end/41535] " krebbel at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2009-10-01 15:58 UTC (permalink / raw)
  To: gcc-bugs

On s390x I see broken debug info generated for the attached C++
testcase (compile with -O2 -g -fPIC).

The debug info contains a symbol reference with a @GOTENT modifier
what should not happen (and is not accepted by gas):

.LLST3:
        .8byte  .LVL3-.Ltext0
        .8byte  .LVL4-.Ltext0
        .2byte  0xa
        .byte   0x9e
        .uleb128 0x8
        .8byte  _ZTISt12future_error@GOTENT
        .8byte  0x0
        .8byte  0x0

The problem is that the sched2 pass breaks the variable location
information by moving an insn setting r1 over a var_location debug
insn describing a variable location as being r1.

in 202.split4:

29:     var_location r10
33:     var_location r13 + 8
34:     var_location r10
30:     r1 = &(A got entry)
31:     r1 = [r1]
83:     [r13] = r2
32:     r1 = [r1]
35:     var_location A => r1  <-- problematic location information 
36:     [r13 + 8] = r10
37:     [r13 + 16] = r1
79:     r1 = &(B got entry)
41:     r3 = [r1]

in 203.sched2:

...
32:     r1 = [r1]
37:     [r13 + 16] = r1
79:     r1 = &(B got entry)  <-- insn moved over 35
83:     [r13] = r2
29:     var_location r10
33:     var_location r13 + 8
34:     var_location r10
35:     var_location r1  !!! the variable location gets corrupted
                         since insn 79 has been moved over it
36:     [r13 + 8] = r10
41:     r3 = [r1]

The variable locations are intended to stay right after the insn which
does the relevant assignment by generating an ANTI dep between them
but we also create deps between unrelated insns:

sched-deps.c:2790
    if (prev && NONDEBUG_INSN_P (prev))
      add_dependence (insn, prev, REG_DEP_ANTI);

This code creates a dependency between 83 and 29 (although the
assignment is unrelated). This together with the fact that all debug
insns are always been kept from being moved over each other makes all
the debug insns to get stuck after insn 83. Although in order to keep
the information correct insn 35 has to stay after 32.


-- 
           Summary: Broken var location info after scheduling
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: krebbel at gcc dot gnu dot org
 GCC build triplet: s390x-ibm-linux
  GCC host triplet: s390x-ibm-linux
GCC target triplet: s390x-ibm-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/41535] Broken var location info after scheduling
  2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
@ 2009-10-01 15:58 ` krebbel at gcc dot gnu dot org
  2009-10-01 22:18 ` [Bug middle-end/41535] [4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: krebbel at gcc dot gnu dot org @ 2009-10-01 15:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from krebbel at gcc dot gnu dot org  2009-10-01 15:58 -------
Created an attachment (id=18687)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18687&action=view)
Testcase

Compile with -O2 -fPIC -g


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/41535] [4.5 Regression] Broken var location info after scheduling
  2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
  2009-10-01 15:58 ` [Bug middle-end/41535] " krebbel at gcc dot gnu dot org
@ 2009-10-01 22:18 ` rguenth at gcc dot gnu dot org
  2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-01 22:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Broken var location info    |[4.5 Regression] Broken var
                   |after scheduling            |location info after
                   |                            |scheduling
   Target Milestone|---                         |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/41535] [4.5 Regression] Broken var location info after scheduling
  2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
  2009-10-01 15:58 ` [Bug middle-end/41535] " krebbel at gcc dot gnu dot org
  2009-10-01 22:18 ` [Bug middle-end/41535] [4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
  2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-07  7:23 UTC (permalink / raw)
  To: gcc-bugs



-- 

aoliva at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-10-07 07:23:25
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/41535] [4.5 Regression] Broken var location info after scheduling
  2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
@ 2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
  2009-10-17  6:30 ` [Bug debug/41535] " aoliva at gcc dot gnu dot org
  2009-10-18  4:57 ` aoliva at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-07  7:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from aoliva at gcc dot gnu dot org  2009-10-07 07:23 -------
Thanks for the bug report, confirmed, looking into it.


-- 

aoliva at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |aoliva at gcc dot gnu dot
                   |dot org                     |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/41535] [4.5 Regression] Broken var location info after scheduling
  2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
@ 2009-10-17  6:30 ` aoliva at gcc dot gnu dot org
  2009-10-18  4:57 ` aoliva at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-17  6:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from aoliva at gcc dot gnu dot org  2009-10-17 06:29 -------
Subject: Bug 41535

Author: aoliva
Date: Sat Oct 17 06:28:43 2009
New Revision: 152927

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152927
Log:
PR debug/41535
* sched-deps.c (depl_on_debug_p): New.
(attach_dep_link): Reject debug deps before nondebug deps.
(add_to_deps_list): Insert debug deps after nondebug deps.
(sd_lists_empty_p): Stop at first nonempty list.  Disregard debug
deps.
(sd_add_dep): Do not reject debug deps.
(add_insn_mem_dependence): Don't count debug deps.
(remove_from_deps): Likewise.
(sched_analyze_2): Set up mem deps on debug insns.
(sched_analyze_insn): Record reg uses for deps on debug insns.
* haifa-sched.c (schedule_insn): Reset deferred debug insn.  Don't
try_ready nondebug insn after debug insn.
* ddg.c (create_ddg_dep_from_intra_loop_link,
create_ddg_dep_no_link): Don't reject debug deps.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ddg.c
    trunk/gcc/haifa-sched.c
    trunk/gcc/sched-deps.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/41535] [4.5 Regression] Broken var location info after scheduling
  2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-10-17  6:30 ` [Bug debug/41535] " aoliva at gcc dot gnu dot org
@ 2009-10-18  4:57 ` aoliva at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-18  4:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from aoliva at gcc dot gnu dot org  2009-10-18 04:57 -------
Fixed


-- 

aoliva at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41535


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-18  4:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-01 15:58 [Bug middle-end/41535] New: Broken var location info after scheduling krebbel at gcc dot gnu dot org
2009-10-01 15:58 ` [Bug middle-end/41535] " krebbel at gcc dot gnu dot org
2009-10-01 22:18 ` [Bug middle-end/41535] [4.5 Regression] " rguenth at gcc dot gnu dot org
2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
2009-10-07  7:23 ` aoliva at gcc dot gnu dot org
2009-10-17  6:30 ` [Bug debug/41535] " aoliva at gcc dot gnu dot org
2009-10-18  4:57 ` aoliva at gcc dot gnu dot org

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).