public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34895] New: ICE at dwarf2out.c:13742
@ 2008-01-21 5:07 theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 5:41 ` [Bug c++/34895] " theodore dot papadopoulo at sophia dot inria dot fr
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: theodore dot papadopoulo at sophia dot inria dot fr @ 2008-01-21 5:07 UTC (permalink / raw)
To: gcc-bugs
The (soon to be attached) code ICEs when compiled with options -g -O2.
This is still true as of gcc version 4.3.0 20080118 (x86_64-unknown-linux-gnu),
it used to pass but I do not know if this was due to the use of a previous
version of the compiler (3.4) or the use of a i386 target (this is most
probable, I will check).
--
Summary: ICE at dwarf2out.c:13742
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: theodore dot papadopoulo at sophia dot inria dot fr
GCC build triplet: x86_64-redhat-linux
GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/34895] ICE at dwarf2out.c:13742
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
@ 2008-01-21 5:41 ` theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 11:03 ` [Bug debug/34895] [4.1/4.2/4.3 Regression] CE in force_type_die, at dwarf2out.c:12923 rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: theodore dot papadopoulo at sophia dot inria dot fr @ 2008-01-21 5:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from theodore dot papadopoulo at sophia dot inria dot fr 2008-01-21 03:15 -------
Created an attachment (id=14984)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14984&action=view)
The code that triggers the ICE
Just compile with -g -O2 to see the problem.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/34895] [4.1/4.2/4.3 Regression] CE in force_type_die, at dwarf2out.c:12923
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 5:41 ` [Bug c++/34895] " theodore dot papadopoulo at sophia dot inria dot fr
@ 2008-01-21 11:03 ` rguenth at gcc dot gnu dot org
2008-01-22 19:49 ` [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE " matz 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 @ 2008-01-21 11:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-01-21 10:15 -------
On trunk, ICEs with plain -g.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Known to fail| |4.1.3 4.3.0
Known to work| |3.3.6
Priority|P3 |P2
Last reconfirmed|0000-00-00 00:00:00 |2008-01-21 10:15:23
date| |
Summary|ICE at dwarf2out.c:13742 |[4.1/4.2/4.3 Regression] CE
| |in force_type_die, at
| |dwarf2out.c:12923
Target Milestone|--- |4.2.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE in force_type_die, at dwarf2out.c:12923
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 5:41 ` [Bug c++/34895] " theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 11:03 ` [Bug debug/34895] [4.1/4.2/4.3 Regression] CE in force_type_die, at dwarf2out.c:12923 rguenth at gcc dot gnu dot org
@ 2008-01-22 19:49 ` matz at gcc dot gnu dot org
2008-01-22 20:09 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: matz at gcc dot gnu dot org @ 2008-01-22 19:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from matz at gcc dot gnu dot org 2008-01-22 18:28 -------
The problem is, that gen_type_die() generates a DIE only for the main variant
of the given type. But lookup_type_die looks in the type itself. In the
example the type in question is "const A", for which no DIE exists already.
So force_type_die() goes into the if(), calls gen_type_die which generated
a DIE for "A" (in fact that already exists, so it just returns). But
a DIE for "const A" still doesn't exist of course. The example can be made to
compile to force such existence, e.g. by adding a member to "A":
struct A {
...
void cmem() const;
};
There are two ways of fixing this:
1) making sure, that "const A" (the tree node) refers to the DIE for "A", i.e.
losing the qualifiers. One could ensure this in either force_type_die
or even gen_type_die by calling equate_type_number_to_die.
2) ensure that force_type_die() really creates a DIE which reflects type
(and not just the main variant).
With the above test one can see, that the intention was, that the AT_import
decl really comes inside the DIE for "const A". So, that speaks for option 2.
This is also the natural choice as a function named "force_type_die" surely
should generate a DIE for that very type and not some other variant of it.
The below patch would implement this.
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 131712)
+++ dwarf2out.c (working copy)
@@ -13736,11 +13736,8 @@ force_type_die (tree type)
else
context_die = comp_unit_die;
- type_die = lookup_type_die (type);
- if (type_die)
- return type_die;
- gen_type_die (type, context_die);
- type_die = lookup_type_die (type);
+ type_die = modified_type_die (type, TYPE_READONLY (type),
+ TYPE_VOLATILE (type), context_die);
gcc_assert (type_die);
}
return type_die;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE in force_type_die, at dwarf2out.c:12923
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
` (2 preceding siblings ...)
2008-01-22 19:49 ` [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE " matz at gcc dot gnu dot org
@ 2008-01-22 20:09 ` jason at gcc dot gnu dot org
2008-01-23 16:50 ` matz at gcc dot gnu dot org
2008-01-23 17:31 ` matz at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-01-22 20:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jason at gcc dot gnu dot org 2008-01-22 20:06 -------
That patch looks right to me. This seems to be a bug caused by the deceptive
name "gen_type_die" which really should be called something like
"gen_main_variant_type_die".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE in force_type_die, at dwarf2out.c:12923
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
` (3 preceding siblings ...)
2008-01-22 20:09 ` jason at gcc dot gnu dot org
@ 2008-01-23 16:50 ` matz at gcc dot gnu dot org
2008-01-23 17:31 ` matz at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: matz at gcc dot gnu dot org @ 2008-01-23 16:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from matz at gcc dot gnu dot org 2008-01-23 16:45 -------
Subject: Bug 34895
Author: matz
Date: Wed Jan 23 16:44:27 2008
New Revision: 131761
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131761
Log:
PR debug/34895
* dwarf2out.c (force_type_die): Use modified_type_die instead of
gen_type_die.
* g++.dg/debug/pr34895.cc: New testcase.
Added:
trunk/gcc/testsuite/g++.dg/debug/pr34895.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE in force_type_die, at dwarf2out.c:12923
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
` (4 preceding siblings ...)
2008-01-23 16:50 ` matz at gcc dot gnu dot org
@ 2008-01-23 17:31 ` matz at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: matz at gcc dot gnu dot org @ 2008-01-23 17:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from matz at gcc dot gnu dot org 2008-01-23 16:54 -------
Fixed.
--
matz at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34895
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-01-23 16:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-21 5:07 [Bug c++/34895] New: ICE at dwarf2out.c:13742 theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 5:41 ` [Bug c++/34895] " theodore dot papadopoulo at sophia dot inria dot fr
2008-01-21 11:03 ` [Bug debug/34895] [4.1/4.2/4.3 Regression] CE in force_type_die, at dwarf2out.c:12923 rguenth at gcc dot gnu dot org
2008-01-22 19:49 ` [Bug debug/34895] [4.1/4.2/4.3 Regression] ICE " matz at gcc dot gnu dot org
2008-01-22 20:09 ` jason at gcc dot gnu dot org
2008-01-23 16:50 ` matz at gcc dot gnu dot org
2008-01-23 17:31 ` matz 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).