This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: new regression in g++.old-deja/g++.other/decl3.C
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 07 Jul 2004 09:38:00 +0100
- Subject: Re: new regression in g++.old-deja/g++.other/decl3.C
- Organization: Codesourcery LLC
- References: <20040706225145.GA24962@redhat.com>
Richard Henderson wrote:
This is BINFO related, Nathan, so I assume it's yours.
hm, it looks like my binfo stuff uncovered, gosh, a latent bug. I need
some help. here's the two slots of the call stack
#5 0x08100293 in cp_fold_obj_type_ref (ref=0x40287b18, known_type=0x402fb32c) at ../../gcc/gcc/cp/class.c:7911
#6 0x0826194e in fold_stmt (stmt_p=0x402f4554) at ../../gcc/gcc/tree-ssa-ccp.c:2072
and it's this code in fold_stmt
/* Check for resolvable OBJ_TYPE_REF. The only sorts we can resolve
here are when we've propagated the address of a decl into the
object slot. */
/* ??? Should perhaps do this in fold proper. However, doing it
there requires that we create a new CALL_EXPR, and that requires
copying EH region info to the new node. Easier to just do it
here where we can just smash the call operand. */
callee = TREE_OPERAND (rhs, 0);
if (TREE_CODE (callee) == OBJ_TYPE_REF
&& lang_hooks.fold_obj_type_ref
&& TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR
&& DECL_P (TREE_OPERAND (OBJ_TYPE_REF_OBJECT (callee), 0)))
{
tree t;
t = TREE_TYPE (TREE_OPERAND (OBJ_TYPE_REF_OBJECT (callee), 0));
t = lang_hooks.fold_obj_type_ref (callee, t); <-- here
if (t)
{
TREE_OPERAND (rhs, 0) = t;
changed = true;
}
}
at this point t is an ARRAY_TYPE (of cow_t), and so can't have any BINFO
stuff of course. Is the fault in fold_stmt passing an array type, or in the
lang hook for not dealing with it?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
struct cow_t {
virtual void f()=0;
};
int main()
{
cow_t cow[2];
cow[0].f();
return 0;
}