public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17347] New: C++ FE produces invalid CONSTRUCTOR trees for vtables
@ 2004-09-07 14:14 dberlin at gcc dot gnu dot org
2004-09-09 3:28 ` [Bug c++/17347] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2004-09-07 14:14 UTC (permalink / raw)
To: gcc-bugs
According to the docs, and what every other frontend does, CONSTRUCTOR_ELTS for
an array type contains a tree_list where:
For ARRAY_TYPE:
The TREE_PURPOSE of each node is the corresponding index.
If the TREE_PURPOSE is a RANGE_EXPR, it is a short-hand for many nodes,
one for each index in the range. (If the corresponding TREE_VALUE
has side-effects, they are evaluated once for each element. Wrap the
value in a SAVE_EXPR if you want to evaluate side effects only once.)
vtables produce an array_type whose constructor list has no TREE_PURPOSE on
each node (it's NULL).
(gdb) p debug_tree (decl)
<var_decl 0x40139414 _ZTVSt9exception
type <array_type 0x401396cc
....
(gdb) p debug_tree (decl.decl.initial)
<constructor 0x4005bb80
arg 0 <tree_list 0x401383c0
value <nop_expr 0x4005bac0 type <pointer_type 0x400cec3c
__vtbl_ptr_type>
constant invariant
arg 0 <integer_cst 0x40138348 constant invariant 0>>
chain <tree_list 0x401383a8
value <nop_expr 0x4005baa0 type <pointer_type 0x400cec3c
__vtbl_ptr_type>
readonly constant invariant
....
(note the lack of purpose trees)
simple testcase:
extern "C++"
{
namespace std
{
class exception
{
public:exception () throw ()
{
} virtual ~ exception () throw ();
virtual const char *what () const throw ();
};
}
namespace __cxxabiv1
{
}
namespace std
{
class bad_cast:public exception
{
public:bad_cast () throw ()
{
} virtual ~ bad_cast () throw ();
};
}
}
namespace __cxxabiv1
{
extern "C" void __cxa_bad_cast ();
}
extern "C" void
__cxxabiv1::__cxa_bad_cast ()
{
throw std::bad_cast ();
}
--
Summary: C++ FE produces invalid CONSTRUCTOR trees for vtables
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dberlin at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17347
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/17347] C++ FE produces invalid CONSTRUCTOR trees for vtables
2004-09-07 14:14 [Bug c++/17347] New: C++ FE produces invalid CONSTRUCTOR trees for vtables dberlin at gcc dot gnu dot org
@ 2004-09-09 3:28 ` pinskia at gcc dot gnu dot org
2004-09-22 9:20 ` giovannibajo at libero dot it
2004-09-24 21:27 ` rth at gcc dot gnu dot org
2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-09 3:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-09 03:27 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-09-09 03:27:38
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17347
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/17347] C++ FE produces invalid CONSTRUCTOR trees for vtables
2004-09-07 14:14 [Bug c++/17347] New: C++ FE produces invalid CONSTRUCTOR trees for vtables dberlin at gcc dot gnu dot org
2004-09-09 3:28 ` [Bug c++/17347] " pinskia at gcc dot gnu dot org
@ 2004-09-22 9:20 ` giovannibajo at libero dot it
2004-09-24 21:27 ` rth at gcc dot gnu dot org
2 siblings, 0 replies; 5+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-22 9:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-09-22 09:20 -------
I think this should be rediscussed. I'm trying to fix PR14179 where we build a
CONSTRUCTOR for 8 million of initializers. It is unfortunate to be forced to
store a progressive INTEGER_CST into the TREE_PURPOSE of each element because
it would waste too much memory.
I know we used to accept a CONSTRUCTOR with empty TREE_PURPOSE pre-tree-ssa,
with the obvious meaning (previous index + 1). Why cannot we do this anymore?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it, rth at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17347
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/17347] C++ FE produces invalid CONSTRUCTOR trees for vtables
2004-09-07 14:14 [Bug c++/17347] New: C++ FE produces invalid CONSTRUCTOR trees for vtables dberlin at gcc dot gnu dot org
2004-09-09 3:28 ` [Bug c++/17347] " pinskia at gcc dot gnu dot org
2004-09-22 9:20 ` giovannibajo at libero dot it
@ 2004-09-24 21:27 ` rth at gcc dot gnu dot org
2 siblings, 0 replies; 5+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-09-24 21:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2004-09-24 21:27 -------
I suppose you *could* re-allow NULL TREE_PURPOSE for arrays. I'd be hesitant
to do this for structures, but there we don't have a problem of allocating
extra memory.
You'd just need a little bit of code in gimplify.c, and perhaps in tree-sra.c,
to make this work. Feel free to persue it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17347
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/17347] C++ FE produces invalid CONSTRUCTOR trees for vtables
[not found] <bug-17347-1@http.gcc.gnu.org/bugzilla/>
@ 2006-05-06 12:08 ` christian dot joensson at gmail dot com
0 siblings, 0 replies; 5+ messages in thread
From: christian dot joensson at gmail dot com @ 2006-05-06 12:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from christian dot joensson at gmail dot com 2006-05-06 12:08 -------
what's the status of this one?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17347
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-06 12:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-07 14:14 [Bug c++/17347] New: C++ FE produces invalid CONSTRUCTOR trees for vtables dberlin at gcc dot gnu dot org
2004-09-09 3:28 ` [Bug c++/17347] " pinskia at gcc dot gnu dot org
2004-09-22 9:20 ` giovannibajo at libero dot it
2004-09-24 21:27 ` rth at gcc dot gnu dot org
[not found] <bug-17347-1@http.gcc.gnu.org/bugzilla/>
2006-05-06 12:08 ` christian dot joensson at gmail dot com
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).