[Bug c++/45605] Missed devirtualization
rguenther at suse dot de
gcc-bugzilla@gcc.gnu.org
Thu Sep 16 16:07:00 GMT 2010
------- Comment #17 from rguenther at suse dot de 2010-09-16 16:06 -------
Subject: Re: Missed devirtualization
On Thu, 16 Sep 2010, jamborm at gcc dot gnu dot org wrote:
>
>
> ------- Comment #16 from jamborm at gcc dot gnu dot org 2010-09-16 16:00 -------
> (In reply to comment #15)
> > Like
> >
> > Index: gimplify.c
> > ===================================================================
> > --- gimplify.c (revision 164333)
> > +++ gimplify.c (working copy)
> > @@ -2477,10 +2477,13 @@ gimplify_call_expr (tree *expr_p, gimple
> > gimplify_modify_expr. */
> > if (!want_value)
> > {
> > + gimple_stmt_iterator gsi;
> > /* The CALL_EXPR in *EXPR_P is already in GIMPLE form, so all we
> > have to do is replicate it as a GIMPLE_CALL tuple. */
> > call = gimple_build_call_from_tree (*expr_p);
> > gimplify_seq_add_stmt (pre_p, call);
> > + gsi = gsi_last (*pre_p);
> > + fold_stmt (&gsi);
> > *expr_p = NULL_TREE;
> > }
> >
>
> Will this also work also for GIMPLE_CALLs with a LHS or do I have to
> add something like the above also elsewhere?
Yes.
> >
> > but gimple_fold_obj_type_ref_known_binfo returns NULL.
> >
>
> cgraph_function_flags_ready needs to be added to the conjunction
> (!node->analyzed && !node->in_other_partition) and then it is folded.
> I'll prepare a patch tomorrow.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45605
More information about the Gcc-bugs
mailing list