public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main
@ 2015-04-20 23:32 chihin.ko at oracle dot com
  2015-04-21  2:57 ` [Bug debug/65821] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: chihin.ko at oracle dot com @ 2015-04-20 23:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65821
           Summary: [4.8.2 regression] incorrect debug line # info for
                    main
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chihin.ko at oracle dot com

this happen since 4.8.2, 4.9.0 also have same problem.

cat t.cc
==========================================================
  1 #include <stdio.h>
  2
  3 int b = 12;
  4
  5 inline void foo(const int &x = (b+3))
  6 {
  7     printf("%d\n", x);
  8 }   9
 10 inline void baz(const int &x = 200)
 11 {
 12     printf("%d\n", x);
 13 }
 14
 15 inline void bar(int &x = b)
 16 {  17     printf("%d\n", x);
 18     x = 100;
 19     printf("%d\n", x);
 20 }
 21
 22
 23 void
 24 bob(char *s = "hello")  25 {
 26     printf("%s\n", s);
 27 }  28
 29 int main()
 30 {
 31   foo();  32   baz();
 33   bar();
 34   bob();
 35   return 0;
 36 }
====================================================
The line table for main is incorrect:

< 1><0x0000067e>    DW_TAG_subprogram
                      DW_AT_external              yes(1)
                      DW_AT_name                  "main"
                      DW_AT_decl_file             0x00000001 t.cc
                      DW_AT_decl_line             0x0000001d
                      DW_AT_type                  <0x00000491>
                      DW_AT_low_pc                0x0040129f
                      DW_AT_high_pc               0x004012ff
.debug_line
---
....
0x0040129f  [  30, 0] NS
0x004012a7  [   5, 0] NS   <==== extra line info
0x004012b0  [  31, 0] NS
0x004012bf  [  32, 0] NS DI=0x1
0x004012d2  [  33, 0] NS
0x004012dc  [  34, 0] NS

This cause follwing problem:
(gdb) b main
Breakpoint 1 at 0x4006ea: file c++defargs3.cc, line 5.  <== should be line 31
(gdb) run
Starting program:
/workspace/chko/ws/dinstall/dbx_test/intel_S11_gcc482/c++defargs3.dbx,gcc/g47/a.out

Breakpoint 1, main () at c++defargs3.cc:5
5       inline void foo(const int &x = (b+3))


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

* [Bug debug/65821] [4.8.2 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
@ 2015-04-21  2:57 ` pinskia at gcc dot gnu.org
  2015-04-21  3:24 ` chihin.ko at oracle dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-04-21  2:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It is doing (b+3) first which is from :5 which seems correct to me.  Default
arguments should have a line information right?


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

* [Bug debug/65821] [4.8.2 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
  2015-04-21  2:57 ` [Bug debug/65821] " pinskia at gcc dot gnu.org
@ 2015-04-21  3:24 ` chihin.ko at oracle dot com
  2015-04-21  7:44 ` [Bug debug/65821] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: chihin.ko at oracle dot com @ 2015-04-21  3:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from chihin ko <chihin.ko at oracle dot com> ---
(In reply to Andrew Pinski from comment #1)
> It is doing (b+3) first which is from :5 which seems correct to me.  Default
> arguments should have a line information right?

Then gdb should stop at line 30 first and when I step into foo(),
it stop at line 5. line 5 should belongs to foo().

Current behavior is confusing to user.


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

* [Bug debug/65821] [4.8/4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
  2015-04-21  2:57 ` [Bug debug/65821] " pinskia at gcc dot gnu.org
  2015-04-21  3:24 ` chihin.ko at oracle dot com
@ 2015-04-21  7:44 ` rguenth at gcc dot gnu.org
  2015-04-21 21:15 ` chihin.ko at oracle dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-21  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-04-21
   Target Milestone|---                         |4.8.5
            Summary|[4.8.2 regression]          |[4.8/4.9/5/6 regression]
                   |incorrect debug line # info |incorrect debug line # info
                   |for main                    |for main
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
What version works correctly?  (please provide the testcase as attachment as
well)


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

* [Bug debug/65821] [4.8/4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (2 preceding siblings ...)
  2015-04-21  7:44 ` [Bug debug/65821] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
@ 2015-04-21 21:15 ` chihin.ko at oracle dot com
  2015-04-21 21:18 ` chihin.ko at oracle dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: chihin.ko at oracle dot com @ 2015-04-21 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from chihin ko <chihin.ko at oracle dot com> ---
(In reply to Richard Biener from comment #3)
> What version works correctly?  (please provide the testcase as attachment as
> well)

< 0><0x0000000b>  DW_TAG_compile_unit
                    DW_AT_producer              "GNU C++ 4.7.2"
                    DW_AT_language              DW_LANG_C_plus_plus
...
...
< 1><0x00000547>    DW_TAG_subprogram
                      DW_AT_external              yes(1)
                      DW_AT_name                  "main"
                      DW_AT_decl_file             0x00000001
/workspace/chko/ws/dinstall/dbx_test/intel_S11_gcc482/c++defargs3.dbx,gcc/g47/c++defargs3.cc
                      DW_AT_decl_line             0x0000001d
                      DW_AT_type                  <0x00000371>
                      DW_AT_low_pc                0x00400b02
                      DW_AT_high_pc               0x00400b62
...
...

0x00400b02  [  30, 0] NS
0x00400b0a  [  31, 0] NS
0x00400b22  [  32, 0] NS DI=0x1
0x00400b35  [  33, 0] NS
0x00400b3f  [  34, 0] NS
0x00400b49  [  35, 0] NS


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

* [Bug debug/65821] [4.8/4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (3 preceding siblings ...)
  2015-04-21 21:15 ` chihin.ko at oracle dot com
@ 2015-04-21 21:18 ` chihin.ko at oracle dot com
  2015-06-23  8:21 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: chihin.ko at oracle dot com @ 2015-04-21 21:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from chihin ko <chihin.ko at oracle dot com> ---
Created attachment 35381
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35381&action=edit
test case 1/1


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

* [Bug debug/65821] [4.8/4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (4 preceding siblings ...)
  2015-04-21 21:18 ` chihin.ko at oracle dot com
@ 2015-06-23  8:21 ` rguenth at gcc dot gnu.org
  2015-06-26 19:58 ` [Bug debug/65821] [4.9/5/6 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23  8:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.5                       |4.9.3

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.


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

* [Bug debug/65821] [4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (5 preceding siblings ...)
  2015-06-23  8:21 ` rguenth at gcc dot gnu.org
@ 2015-06-26 19:58 ` jakub at gcc dot gnu.org
  2015-06-26 20:28 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


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

* [Bug debug/65821] [4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (6 preceding siblings ...)
  2015-06-26 19:58 ` [Bug debug/65821] [4.9/5/6 " jakub at gcc dot gnu.org
@ 2015-06-26 20:28 ` jakub at gcc dot gnu.org
  2015-06-30 10:23 ` rguenth at gcc dot gnu.org
  2020-12-09 13:45 ` [Bug debug/65821] [7 " jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


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

* [Bug debug/65821] [4.9/5/6 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (7 preceding siblings ...)
  2015-06-26 20:28 ` jakub at gcc dot gnu.org
@ 2015-06-30 10:23 ` rguenth at gcc dot gnu.org
  2020-12-09 13:45 ` [Bug debug/65821] [7 " jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-30 10:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|WAITING                     |NEW
      Known to work|                            |4.7.2


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

* [Bug debug/65821] [7 regression] incorrect debug line # info for main
  2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
                   ` (8 preceding siblings ...)
  2015-06-30 10:23 ` rguenth at gcc dot gnu.org
@ 2020-12-09 13:45 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2020-12-09 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #18 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed in all active releases.

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

end of thread, other threads:[~2020-12-09 13:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-20 23:32 [Bug debug/65821] New: [4.8.2 regression] incorrect debug line # info for main chihin.ko at oracle dot com
2015-04-21  2:57 ` [Bug debug/65821] " pinskia at gcc dot gnu.org
2015-04-21  3:24 ` chihin.ko at oracle dot com
2015-04-21  7:44 ` [Bug debug/65821] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-04-21 21:15 ` chihin.ko at oracle dot com
2015-04-21 21:18 ` chihin.ko at oracle dot com
2015-06-23  8:21 ` rguenth at gcc dot gnu.org
2015-06-26 19:58 ` [Bug debug/65821] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:28 ` jakub at gcc dot gnu.org
2015-06-30 10:23 ` rguenth at gcc dot gnu.org
2020-12-09 13:45 ` [Bug debug/65821] [7 " jason at gcc dot gnu.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).