public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct
@ 2010-05-18 9:32 rguenth at gcc dot gnu dot org
2010-05-18 21:50 ` [Bug c++/44188] " dodji at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-18 9:32 UTC (permalink / raw)
To: gcc-bugs
typedef struct
{
int i;
} AAA;
typedef struct BBB
{
int i;
} BBB;
int main(void) {
BBB bb;
AAA aa;
return 0;
}
produces
<3><a2>: Abbrev Number: 9 (DW_TAG_variable)
<a3> DW_AT_name : bb
<a6> DW_AT_decl_file : 1
<a7> DW_AT_decl_line : 13
<a8> DW_AT_type : <0x66>
<ac> DW_AT_location : 2 byte block: 91 60 (DW_OP_fbreg: -32)
<3><af>: Abbrev Number: 9 (DW_TAG_variable)
<b0> DW_AT_name : aa
<b3> DW_AT_decl_file : 1
<b4> DW_AT_decl_line : 14
<b5> DW_AT_type : <0x2d>
<b9> DW_AT_location : 2 byte block: 91 50
where
<1><66>: Abbrev Number: 6 (DW_TAG_typedef)
<67> DW_AT_name : BBB
<6b> DW_AT_decl_file : 1
<6c> DW_AT_decl_line : 10
<6d> DW_AT_type : <0x4d>
(good)
<1><2d>: Abbrev Number: 2 (DW_TAG_structure_type)
<2e> DW_AT_byte_size : 4
<2f> DW_AT_decl_file : 1
<30> DW_AT_decl_line : 3
<31> DW_AT_name : AAA
<35> DW_AT_sibling : <0x46>
(bad)
This seems to be because in gen_type_die_with_usage we arrive with a
type that has a non-typedef type-decl as its name.
--
Summary: Fails to produce DW_AT_typedef for typedef of anonymous
struct
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: wrong-debug
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
@ 2010-05-18 21:50 ` dodji at gcc dot gnu dot org
2010-05-20 11:07 ` dodji at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-05-18 21:50 UTC (permalink / raw)
To: gcc-bugs
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dodji at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-05-18 21:50:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
2010-05-18 21:50 ` [Bug c++/44188] " dodji at gcc dot gnu dot org
@ 2010-05-20 11:07 ` dodji at gcc dot gnu dot org
2010-05-27 19:30 ` dodji at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-05-20 11:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dodji at gcc dot gnu dot org 2010-05-20 11:06 -------
A patch has been proposed to
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01476.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
2010-05-18 21:50 ` [Bug c++/44188] " dodji at gcc dot gnu dot org
2010-05-20 11:07 ` dodji at gcc dot gnu dot org
@ 2010-05-27 19:30 ` dodji at gcc dot gnu dot org
2010-05-27 19:36 ` dodji at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-05-27 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dodji at gcc dot gnu dot org 2010-05-27 19:30 -------
Subject: Bug 44188
Author: dodji
Date: Thu May 27 19:29:53 2010
New Revision: 159943
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159943
Log:
Fix PR c++/44188
gcc/ChangeLog:
PR c++/44188
* c-common.c (is_typedef_decl): Move this definition ...
* tree.c (is_typedef_decl): ... here.
(typdef_variant_p): Move definition here from gcc/cp/tree.c.
* c-common.h (is_typedef_decl): Move this declaration ...
* tree.h (is_typedef_decl): ... here.
(typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h
* dwarf2out.c (is_naming_typedef_decl): New function.
(gen_tagged_type_die): Split out of ...
(gen_type_die_with_usage): ... this function. When an anonymous
tagged type is named by a typedef, make sure a DW_TAG_typedef DIE
is emitted for the typedef.
(gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming
anonymous tagged types.
gcc/cp/ChangeLog:
PR c++/44188
* cp-tree.h (typedef_variant_p): Move this declaration to
gcc/tree.h.
* tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
* decl.c (grokdeclarator): Do not rename debug info of an
anonymous tagged type named by a typedef.
gcc/testsuite/ChangeLog:
PR c++/44188
* g++.dg/debug/dwarf2/typedef3.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c-common.h
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/tree.c
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c
trunk/gcc/tree.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-05-27 19:30 ` dodji at gcc dot gnu dot org
@ 2010-05-27 19:36 ` dodji at gcc dot gnu dot org
2010-05-27 20:51 ` jakub at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-05-27 19:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dodji at gcc dot gnu dot org 2010-05-27 19:36 -------
Fixed in trunk (4.6).
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-05-27 19:36 ` dodji at gcc dot gnu dot org
@ 2010-05-27 20:51 ` jakub at gcc dot gnu dot org
2010-05-28 0:03 ` dodji at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-05-27 20:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2010-05-27 20:50 -------
Not 100% sure yet, but I believe this commit broke bootstrap on both
x86_64-linux and i686-linux, e.g. in libobjc or in ada bits.
One of the ICEs I'm seeing is:
#0 fancy_abort (file=0x8d1d1e3 "../../gcc/dwarf2out.c", line=16990,
function=0x8d21b15 "add_byte_size_attribute") at ../../gcc/diagnostic.c:782
#1 0x0823486f in add_byte_size_attribute (die=0xf7d76a20, tree_node=<value
optimized out>) at ../../gcc/dwarf2out.c:16990
#2 0x082568d3 in gen_struct_or_union_type_die (type=0xf7d52cc0,
context_die=0xf7d633f0, usage=<value optimized out>)
at ../../gcc/dwarf2out.c:19329
#3 gen_tagged_type_die (type=0xf7d52cc0, context_die=0xf7d633f0, usage=<value
optimized out>) at ../../gcc/dwarf2out.c:19502
#4 0x08257e9a in gen_typedef_die (decl=0xf7d600d8, context_die=0xf7d633f0) at
../../gcc/dwarf2out.c:19430
#5 0x08255a59 in gen_decl_die (decl=0xf7d600d8, origin=<value optimized out>,
context_die=0xf7d633f0) at ../../gcc/dwarf2out.c:20186
gen_typedef_die is called on:
<type_decl 0xf7d600d8 id
type <pointer_type 0xf7d52cc0 id
type <record_type 0xf7d52c00 objc_object asm_written type_0 SI
size <integer_cst 0xf7ce8258 constant 32>
unit size <integer_cst 0xf7ce8090 constant 4>
align 32 symtab -136878016 alias set -1 canonical type 0xf7d52c00
fields <field_decl 0xf7d62a6c class_pointer>
pointer_to_this <pointer_type 0xf7d52cc0 id> chain <type_decl
0xf7d60000 D.1196>>
asm_written unsigned SI size <integer_cst 0xf7ce8258 32> unit size
<integer_cst 0xf7ce8090 4>
align 32 symtab -136877536 alias set -1 canonical type 0xf7d52cc0>
asm_written VOID file /usr/src/gcc/libobjc/objc/objc.h line 72 col 4
align 1>
Given the comments, I wonder if:
--- dwarf2out.c.jj3 2010-05-27 21:48:57.000000000 +0200
+++ dwarf2out.c 2010-05-27 22:50:22.000000000 +0200
@@ -19427,7 +19427,9 @@ gen_typedef_die (tree decl, dw_die_ref c
generate that DIE right away. add_type_attribute
called below will then pick (via lookup_type_die) that
anonymous struct DIE. */
- gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
+ if (RECORD_OR_UNION_TYPE_P (type)
+ || TREE_CODE (type) == ENUMERAL_TYPE)
+ gen_tagged_type_die (type, context_die, DINFO_USAGE_DIR_USE);
}
add_type_attribute (type_die, type, TREE_READONLY (decl),
isn't intended, calling gen_tagged_type_die on a POINTER_TYPE is weird.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (4 preceding siblings ...)
2010-05-27 20:51 ` jakub at gcc dot gnu dot org
@ 2010-05-28 0:03 ` dodji at gcc dot gnu dot org
2010-05-28 0:08 ` dodji at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-05-28 0:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dodji at gcc dot gnu dot org 2010-05-28 00:03 -------
Subject: Bug 44188
Author: dodji
Date: Fri May 28 00:03:19 2010
New Revision: 159955
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159955
Log:
Revert "Fix PR c++/44188"
gcc/ChangeLog:
revert fix for PR c++/44188
* c-common.c (is_typedef_decl): Revert the moving of this
definition ...
* tree.c (is_typedef_decl): ... here.
(typdef_variant_p): Revert the moving of this definition
here from gcc/cp/tree.c.
* c-common.h (is_typedef_decl): Revert the moving of this
declaration ...
* tree.h (is_typedef_decl): ... here.
(typedef_variant_p): Revert the moving of this declaration here
from gcc/cp/cp-tree.h
* dwarf2out.c (is_naming_typedef_decl): Revert this new function.
(gen_tagged_type_die): Revert the splitting out of ...
(gen_type_die_with_usage): ... this function. Revert the anonymous
tagged type handling.
(gen_typedef_die): Revert emitting DW_TAG_typedef for
typedefs naming anonymous tagged types.
gcc/cp/ChangeLog:
Revert fix of PR c++/44188
* cp-tree.h (typedef_variant_p): Revert moving this declaration to
gcc/tree.h.
* tree.c (typedef_variant_p): Revert moving this definition to
gcc/tree.c.
* decl.c (grokdeclarator): Revert naming typedef handling.
gcc/testsuite/ChangeLog:
Revert fix for PR c++/44188
* g++.dg/debug/dwarf2/typedef3.C: Revert new test.
Removed:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c-common.h
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/tree.c
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c
trunk/gcc/tree.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (5 preceding siblings ...)
2010-05-28 0:03 ` dodji at gcc dot gnu dot org
@ 2010-05-28 0:08 ` dodji at gcc dot gnu dot org
2010-06-05 20:03 ` dodji at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-05-28 0:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from dodji at gcc dot gnu dot org 2010-05-28 00:08 -------
Re-opening as my patch broke Ada and Obj-c(++).
It looks like Ada emits TYPE_DECLs that smell like c/c++ naming typedefs but
with different semantics ...
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (7 preceding siblings ...)
2010-06-05 20:03 ` dodji at gcc dot gnu dot org
@ 2010-06-05 20:03 ` dodji at gcc dot gnu dot org
2010-06-06 18:25 ` dodji at gcc dot gnu dot org
2010-06-06 18:33 ` dodji at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-06-05 20:03 UTC (permalink / raw)
To: gcc-bugs
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |ASSIGNED
Last reconfirmed|2010-05-18 21:50:32 |2010-06-05 20:03:35
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (6 preceding siblings ...)
2010-05-28 0:08 ` dodji at gcc dot gnu dot org
@ 2010-06-05 20:03 ` dodji at gcc dot gnu dot org
2010-06-05 20:03 ` dodji at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-06-05 20:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dodji at gcc dot gnu dot org 2010-06-05 20:03 -------
So I posted an updated patch for this to
http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00437.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (8 preceding siblings ...)
2010-06-05 20:03 ` dodji at gcc dot gnu dot org
@ 2010-06-06 18:25 ` dodji at gcc dot gnu dot org
2010-06-06 18:33 ` dodji at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-06-06 18:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dodji at gcc dot gnu dot org 2010-06-06 18:24 -------
Subject: Bug 44188
Author: dodji
Date: Sun Jun 6 18:24:27 2010
New Revision: 160347
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160347
Log:
Fix PR c++/44188
gcc/ChangeLog:
PR c++/44188
* c-common.c (is_typedef_decl): Move this definition ...
* tree.c (is_typedef_decl): ... here.
(typdef_variant_p): Move definition here from gcc/cp/tree.c.
* c-common.h (is_typedef_decl): Move this declaration ...
* tree.h (is_typedef_decl): ... here.
(typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h
* dwarf2out.c (is_naming_typedef_decl): New function.
(gen_tagged_type_die): Split out of ...
(gen_type_die_with_usage): ... this function. When an anonymous
tagged type is named by a typedef, make sure a DW_TAG_typedef DIE
is emitted for the typedef.
(gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming
anonymous tagged types.
gcc/cp/ChangeLog:
PR c++/44188
* cp-tree.h (typedef_variant_p): Move this declaration to
gcc/tree.h.
* tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
* decl.c (grokdeclarator): Do not rename debug info of an
anonymous tagged type named by a typedef.
gcc/testsuite/ChangeLog:
PR c++/44188
* g++.dg/debug/dwarf2/typedef3.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/c-family/c-common.h
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/tree.c
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c
trunk/gcc/tree.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/44188] Fails to produce DW_AT_typedef for typedef of anonymous struct
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
` (9 preceding siblings ...)
2010-06-06 18:25 ` dodji at gcc dot gnu dot org
@ 2010-06-06 18:33 ` dodji at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-06-06 18:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from dodji at gcc dot gnu dot org 2010-06-06 18:33 -------
Hopefully properly fixed in trunk (4.6) now.
--
dodji at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44188
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-06-06 18:33 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 9:32 [Bug c++/44188] New: Fails to produce DW_AT_typedef for typedef of anonymous struct rguenth at gcc dot gnu dot org
2010-05-18 21:50 ` [Bug c++/44188] " dodji at gcc dot gnu dot org
2010-05-20 11:07 ` dodji at gcc dot gnu dot org
2010-05-27 19:30 ` dodji at gcc dot gnu dot org
2010-05-27 19:36 ` dodji at gcc dot gnu dot org
2010-05-27 20:51 ` jakub at gcc dot gnu dot org
2010-05-28 0:03 ` dodji at gcc dot gnu dot org
2010-05-28 0:08 ` dodji at gcc dot gnu dot org
2010-06-05 20:03 ` dodji at gcc dot gnu dot org
2010-06-05 20:03 ` dodji at gcc dot gnu dot org
2010-06-06 18:25 ` dodji at gcc dot gnu dot org
2010-06-06 18:33 ` dodji 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).