https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88112

--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 21 Nov 2018, rguenther at suse dot de wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88112
> 
> --- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> ---
> On Wed, 21 Nov 2018, ebotcazou at gcc dot gnu.org wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88112
> > 
> > --- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> > > It's a type that only lives in the abstract origin which is never output,
> > > so the FE somewhat has a point in not needing to gimplify it (similar
> > > to the Ada case with gloBal types that cannot be gimplified).
> > 
> > So why not set a flag and clear the sizepos only in this case.  Or else 
> > reset
> > the sizepos to PLACEHOLDER_EXPR in the C++ front-end.
> 
> I will need to dig down what happens there in detail.

OK, so the C++ FE creates clones for constructors which the symtab
reachability code marks as "used_as_abstract_origin" but then still
removes as unreachable before gimplification.  Note the clones
do not have a body (maybe a testcase detail) but a BLOCK tree
with the VAR_DECLs causing the issue (and those are refered to
as DECL_ABSTRACT_ORIGIN as well).  Given there's no DECL_EXPRs
I doubt the vars would be gimplified properly (the gimplifier
doesn't walk DECL_INITIAL to pick up unused vars).

So short of avoiding the streaming of trees that are only targets
of abstract origins (the idea of streaming those as references to
DIEs rather than references to trees) a pragmatic "fix" is to
simply allow CALL_EXPRs to be streamed which fixes this testcase
since we do allow streaming of quite arbitrary GENERIC expressions
but fall short of streaming some of the extra flags (for CALL_EXPRs
it seems we only lack CALL_EXPR_BY_DESCRIPTOR and CALL_EXPR_IFN).
For some reason it works for the testcase but we fail to handle
VL_EXP tcc_expression code streaming properly.  I'll see to implement
CALL_EXPR streaming.

Reply via email to