public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
@ 2010-10-20 16:54 zsojka at seznam dot cz
2010-10-20 17:57 ` [Bug debug/46101] " rguenth at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2010-10-20 16:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
Summary: [4.6 Regression] ICE: in build_abbrev_table, at
dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: zsojka@seznam.cz
Created attachment 22097
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22097
reduced testcase
Compiler output:
$ gcc -feliminate-dwarf2-dups -g pr46101.C
pr46101.C:6:4: internal compiler error: in build_abbrev_table, at
dwarf2out.c:10333
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Tested revisions:
r165719 - crash
r161659 - crash
r159696 - OK
4.5 r163761 - OK
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
@ 2010-10-20 17:57 ` rguenth at gcc dot gnu.org
2010-10-20 22:03 ` hjl.tools at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-10-20 17:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
2010-10-20 17:57 ` [Bug debug/46101] " rguenth at gcc dot gnu.org
@ 2010-10-20 22:03 ` hjl.tools at gmail dot com
2010-10-26 0:40 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-20 22:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.10.20 22:03:18
CC| |dseketel at redhat dot com,
| |hjl.tools at gmail dot com
Ever Confirmed|0 |1
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-20 22:03:18 UTC ---
It is caused by revision 160347:
http://gcc.gnu.org/ml/gcc-cvs/2010-06/msg00260.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
2010-10-20 17:57 ` [Bug debug/46101] " rguenth at gcc dot gnu.org
2010-10-20 22:03 ` hjl.tools at gmail dot com
@ 2010-10-26 0:40 ` jakub at gcc dot gnu.org
2010-11-14 14:19 ` dodji at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-26 0:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
` (2 preceding siblings ...)
2010-10-26 0:40 ` jakub at gcc dot gnu.org
@ 2010-11-14 14:19 ` dodji at gcc dot gnu.org
2010-11-14 15:06 ` dodji at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2010-11-14 14:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
Dodji Seketeli <dodji at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC|dseketel at redhat dot com |dodji at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |dodji at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
` (3 preceding siblings ...)
2010-11-14 14:19 ` dodji at gcc dot gnu.org
@ 2010-11-14 15:06 ` dodji at gcc dot gnu.org
2010-11-15 10:23 ` dodji at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2010-11-14 15:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
--- Comment #2 from Dodji Seketeli <dodji at gcc dot gnu.org> 2010-11-14 14:15:06 UTC ---
I am currently testing the patch below:
>From d16601c89e153c54ef017cca5db854898d9c6502 Mon Sep 17 00:00:00 2001
From: Dodji Seketeli <dodji@redhat.com>
Date: Sun, 14 Nov 2010 12:55:34 +0100
Subject: [PATCH 1/2] Fix PR debug/46101
gcc/
* dwarf2out.c (lookup_type_die_strip_naming_typedef): New
function.
(gen_generic_params_dies, scope_die_for, gen_type_die_for_member):
Replace uses of lookup_type_die with use of
lookup_type_die_strip_naming_typedef.
gcc/testsuite/
* g++.dg/debug/dwarf2/typedef5.C: New test
---
gcc/dwarf2out.c | 28 +++++++++++++++++++++++--
gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C | 10 +++++++++
2 files changed, 35 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9bb569b..1094a9f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -6160,6 +6160,7 @@ static void remove_child_TAG (dw_die_ref, enum
dwarf_tag);
static void add_child_die (dw_die_ref, dw_die_ref);
static dw_die_ref new_die (enum dwarf_tag, dw_die_ref, tree);
static dw_die_ref lookup_type_die (tree);
+static dw_die_ref lookup_type_die_strip_naming_typedef (tree);
static void equate_type_number_to_die (tree, dw_die_ref);
static hashval_t decl_die_table_hash (const void *);
static int decl_die_table_eq (const void *, const void *);
@@ -7920,6 +7921,27 @@ lookup_type_die (tree type)
return TYPE_SYMTAB_DIE (type);
}
+/* Like lookup_type_die, but if type is an anonymous type named by a
+ typedef[1], return the DIE of the anonymous type instead the one of
+ the naming typedef. This is because in gen_typedef_die, we did
+ equate the anonymous struct named by the typedef with the DIE of
+ the naming typedef. So by default, lookup_type_die on an anonymous
+ struct yields the DIE of the naming typedef.
+
+ [1]: Read the comment of is_naming_typedef_decl to learn about what
+ a naming typedef is. */
+
+static inline dw_die_ref
+lookup_type_die_strip_naming_typedef (tree type)
+{
+ dw_die_ref die = lookup_type_die (type);
+ if (TREE_CODE (type) == RECORD_TYPE
+ && die->die_tag == DW_TAG_typedef
+ && is_naming_typedef_decl (TYPE_NAME (type)))
+ die = get_AT_ref (die, DW_AT_type);
+ return die;
+}
+
/* Equate a DIE to a given type specifier. */
static inline void
@@ -12883,7 +12905,7 @@ gen_generic_params_dies (tree t)
return;
if (TYPE_P (t))
- die = lookup_type_die (t);
+ die = lookup_type_die_strip_naming_typedef (t);
else if (DECL_P (t))
die = lookup_decl_die (t);
@@ -17763,7 +17785,7 @@ scope_die_for (tree t, dw_die_ref context_die)
scope_die = comp_unit_die ();
}
else
- scope_die = lookup_type_die (containing_scope);
+ scope_die = lookup_type_die_strip_naming_typedef (containing_scope);
}
else
scope_die = context_die;
@@ -18590,7 +18612,7 @@ gen_type_die_for_member (tree type, tree member,
dw_die_ref context_die)
gcc_assert (!decl_ultimate_origin (member));
push_decl_scope (type);
- type_die = lookup_type_die (type);
+ type_die = lookup_type_die_strip_naming_typedef (type);
if (TREE_CODE (member) == FUNCTION_DECL)
gen_subprogram_die (member, type_die);
else if (TREE_CODE (member) == FIELD_DECL)
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
b/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
new file mode 100644
index 0000000..d9d058c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
@@ -0,0 +1,10 @@
+// Origin: PR debug/46101
+// { dg-options "-g -feliminate-dwarf2-dups" }
+// { dg-do compile }
+
+typedef struct
+{
+ virtual void f () { }
+} A;
+
+A a;
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
` (4 preceding siblings ...)
2010-11-14 15:06 ` dodji at gcc dot gnu.org
@ 2010-11-15 10:23 ` dodji at gcc dot gnu.org
2010-11-29 16:32 ` dodji at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2010-11-15 10:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
--- Comment #3 from Dodji Seketeli <dodji at gcc dot gnu.org> 2010-11-15 10:17:41 UTC ---
Patch posted to http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01489.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
` (5 preceding siblings ...)
2010-11-15 10:23 ` dodji at gcc dot gnu.org
@ 2010-11-29 16:32 ` dodji at gcc dot gnu.org
2010-12-13 1:29 ` zsojka at seznam dot cz
2011-01-19 16:46 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2010-11-29 16:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
--- Comment #4 from Dodji Seketeli <dodji at gcc dot gnu.org> 2010-11-29 16:29:11 UTC ---
Author: dodji
Date: Mon Nov 29 16:29:05 2010
New Revision: 167246
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167246
Log:
Fix PR debug/46101
gcc/
* dwarf2out.c (lookup_type_die_strip_naming_typedef): New
function.
(scope_die_for, gen_type_die_for_member): Replace uses of
lookup_type_die with use of lookup_type_die_strip_naming_typedef.
gcc/testsuite/
* g++.dg/debug/dwarf2/typedef5.C: New test
Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
` (6 preceding siblings ...)
2010-11-29 16:32 ` dodji at gcc dot gnu.org
@ 2010-12-13 1:29 ` zsojka at seznam dot cz
2011-01-19 16:46 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-13 1:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
--- Comment #5 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-13 01:29:11 UTC ---
Created attachment 22729
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22729
another testcase
Running testsuite with -g -feliminate-dwarf2-dups still gives similiar (or the
same?) ICE. It seems those failures happen only in C++0x mode. Attached is one
such reduced testcase. Should I open new PR for that?
$ gcc -std=c++0x -g -feliminate-dwarf2-dups pr46101-2.C
pr46101-2.C:8:4: internal compiler error: in build_abbrev_table, at
dwarf2out.c:10476
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Tha failing assert is:
gcc_assert (dwarf_version >= 4 || AT_ref (a)->die_id.die_symbol);
(indeed it passes with -gdwarf-4)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/46101] [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
` (7 preceding siblings ...)
2010-12-13 1:29 ` zsojka at seznam dot cz
@ 2011-01-19 16:46 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-19 16:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46101
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-19 16:31:59 UTC ---
Yes, please open a new bug. Fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-01-19 16:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-20 16:54 [Bug debug/46101] New: [4.6 Regression] ICE: in build_abbrev_table, at dwarf2out.c:10333 with -feliminate-dwarf2-dups -g zsojka at seznam dot cz
2010-10-20 17:57 ` [Bug debug/46101] " rguenth at gcc dot gnu.org
2010-10-20 22:03 ` hjl.tools at gmail dot com
2010-10-26 0:40 ` jakub at gcc dot gnu.org
2010-11-14 14:19 ` dodji at gcc dot gnu.org
2010-11-14 15:06 ` dodji at gcc dot gnu.org
2010-11-15 10:23 ` dodji at gcc dot gnu.org
2010-11-29 16:32 ` dodji at gcc dot gnu.org
2010-12-13 1:29 ` zsojka at seznam dot cz
2011-01-19 16:46 ` rguenth 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).