public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
@ 2003-09-17 19:14 carlo at alinoe dot com
  2003-09-17 19:32 ` [Bug debug/12319] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: carlo at alinoe dot com @ 2003-09-17 19:14 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Wrong DW_AT_low_pc and DW_AT_high_pc for
                    DW_TAG_inlined_subroutine
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carlo at alinoe dot com
                CC: gcc-bugs at gcc dot gnu dot org

Consider the following code snippet:

# cat troep.c
extern int a;

inline void g()
{
  a = a + 1;     // line 5
}

void f()
{
  g();
}                // line 11

Compiled as

# gcc-cvs-3.4 -g -O3 -c troep.c

Then the DWARF2 .debug_info section contains
wrong information:

# readelf --debug-dump troep.o
[...]
 <2><5b>: Abbrev Number: 7 (DW_TAG_inlined_subroutine)
     DW_AT_abstract_origin: <25>
     DW_AT_low_pc      : 0x10 16
     DW_AT_high_pc     : 0x1b 27

Where <25> refers to:

 <1><25>: Abbrev Number: 2 (DW_TAG_subprogram)
     DW_AT_external    : 1
     DW_AT_name        : g

Note that function f() has:

 <1><3b>: Abbrev Number: 4 (DW_TAG_subprogram)
     DW_AT_sibling     : <48>
     DW_AT_external    : 1
     DW_AT_name        : f

Ie, it is <3b>, and

 <1><48>: Abbrev Number: 6 (DW_TAG_subprogram)
     DW_AT_sibling     : <69>
     DW_AT_abstract_origin: <3b>
     DW_AT_low_pc      : 0x10 16
     DW_AT_high_pc     : 0x1b 27

In other words, f() starts at offset 0x10 and
ends at 0x1b: its total size is 11 bytes.
That is correct.

What is wrong is that the inlined g() is said
to ALSO start at 0x10 and end at 0x1b.  This
is 100% nonsense.

troep.s:

.globl _Z1fv
        .type   _Z1fv,@function
_Z1fv:
.LFB3:
        .file 1 "troep.cc"
        .loc 1 9 0
.LBB2:
.LBB3:
.LBB4:
        pushl   %ebp            <-- Start of f() (offset 0x10)
.LCFI0:
        movl    %esp, %ebp
.LCFI1:
        .loc 1 5 0              <-- debug file/line number change (line 5)
        incl    a               <-- Start of inlined g() (offset 0x13!)
        .loc 1 11 0             <-- debug file/line number change (line 11)
        leave                   <-- End of inlined g() (offset 0x19!)
        ret
                                <-- End of f() (offset 0x1b)

See also disassembly:

# objdump -d troep.o
[...]
00000010 <f>:
  10:   55                      push   %ebp
  11:   89 e5                   mov    %esp,%ebp
  13:   ff 05 00 00 00 00       incl   0x0
  19:   5d                      pop    %ebp
  1a:   c3                      ret


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
@ 2003-09-17 19:32 ` pinskia at gcc dot gnu dot org
  2003-09-20 15:59 ` carlo at alinoe dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-17 19:32 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-17 18:34 -------
This is a dup of bug 10003.

*** This bug has been marked as a duplicate of 10003 ***


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
  2003-09-17 19:32 ` [Bug debug/12319] " pinskia at gcc dot gnu dot org
@ 2003-09-20 15:59 ` carlo at alinoe dot com
  2003-09-20 16:44 ` carlo at alinoe dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: carlo at alinoe dot com @ 2003-09-20 15:59 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


carlo at alinoe dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


------- Additional Comments From carlo at alinoe dot com  2003-09-20 14:56 -------
This is NOT a duplicate of 10003.
I will post a patch for this shortly,
the patch doesn't fix PR 10003.


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
  2003-09-17 19:32 ` [Bug debug/12319] " pinskia at gcc dot gnu dot org
  2003-09-20 15:59 ` carlo at alinoe dot com
@ 2003-09-20 16:44 ` carlo at alinoe dot com
  2003-09-29 17:40 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: carlo at alinoe dot com @ 2003-09-20 16:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From carlo at alinoe dot com  2003-09-20 16:36 -------
Created an attachment (id=4788)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4788&action=view)
Patch for PR 12319

I tested this patch, it works great.
I'll have a closer look to PR 10003 now because
that is at least related - and maybe a duplicate
anyway (although wrongly formulated, which is
why I thought it was not a duplicate).


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
                   ` (2 preceding siblings ...)
  2003-09-20 16:44 ` carlo at alinoe dot com
@ 2003-09-29 17:40 ` pinskia at gcc dot gnu dot org
  2003-09-30  4:09 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-29 17:40 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-09-29 17:05:32
               date|                            |


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
                   ` (4 preceding siblings ...)
  2003-09-30  4:09 ` pinskia at gcc dot gnu dot org
@ 2003-09-30  4:09 ` cvs-commit at gcc dot gnu dot org
  2003-10-17 18:18 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-30  4:09 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-09-29 23:09 -------
Subject: Bug 12319

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	carlo@gcc.gnu.org	2003-09-29 23:09:13

Modified files:
	gcc            : ChangeLog cfglayout.c 

Log message:
	PR debug/12319
	* cfglayout.c (insn_scope):  Use prologue_locator and
	epilogue_locator; return the outer function scope for
	pro- and epilogue insns.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1222&r2=2.1223
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfglayout.c.diff?cvsroot=gcc&r1=1.46&r2=1.47


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
                   ` (3 preceding siblings ...)
  2003-09-29 17:40 ` pinskia at gcc dot gnu dot org
@ 2003-09-30  4:09 ` pinskia at gcc dot gnu dot org
  2003-09-30  4:09 ` cvs-commit at gcc dot gnu dot org
  2003-10-17 18:18 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-30  4:09 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-29 23:15 -------
Fixed by the patch.


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

* [Bug debug/12319] Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine
  2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
                   ` (5 preceding siblings ...)
  2003-09-30  4:09 ` cvs-commit at gcc dot gnu dot org
@ 2003-10-17 18:18 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-17 18:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4


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

end of thread, other threads:[~2003-10-17 18:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-17 19:14 [Bug debug/12319] New: Wrong DW_AT_low_pc and DW_AT_high_pc for DW_TAG_inlined_subroutine carlo at alinoe dot com
2003-09-17 19:32 ` [Bug debug/12319] " pinskia at gcc dot gnu dot org
2003-09-20 15:59 ` carlo at alinoe dot com
2003-09-20 16:44 ` carlo at alinoe dot com
2003-09-29 17:40 ` pinskia at gcc dot gnu dot org
2003-09-30  4:09 ` pinskia at gcc dot gnu dot org
2003-09-30  4:09 ` cvs-commit at gcc dot gnu dot org
2003-10-17 18:18 ` pinskia 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).