This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ frontend generating bogous trees
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 15 Feb 2005 22:26:31 +0100
- Subject: Re: C++ frontend generating bogous trees
- References: <Pine.LNX.4.44.0502151849190.26740-100000@alwazn.tat.physik.uni-tuebingen.de>
- Reply-to: Richard Guenther <richard dot guenther at gmail dot com>
Ok, I guess the following excerpts from cp/typechk.c show a discrepancy:
tree
build_address (tree t)
{
tree addr;
if (error_operand_p (t) || !cxx_mark_addressable (t))
return error_mark_node;
addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t);
return addr;
}
1381 (decay_conversion)
ptrtype = build_pointer_type (TREE_TYPE (type));
if (TREE_CODE (exp) == VAR_DECL)
{
if (!cxx_mark_addressable (exp))
return error_mark_node;
adr = build_nop (ptrtype, build_address (exp));
return adr;
}
where of course we are doing redundant work, but we are also
building an ADDR_EXPR with the wrong type. I guess the above
should rather read
if (TREE_CODE (exp) == VAR_DECL)
{
if (!cxx_mark_addressable (exp))
return error_mark_node;
adr = build1 (ADDR_EXPR, ptrtype, exp);
return adr;
}
no? At least this let's my bootstrap continue.