This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR tree-optimization/45605
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Fri, 17 Sep 2010 11:49:37 +0200
- Subject: Re: PR tree-optimization/45605
- References: <20100916234812.GE6006@kam.mff.cuni.cz>
Hi,
On Fri, Sep 17, 2010 at 01:48:12AM +0200, Jan Hubicka wrote:
> Hi,
> this patch fixes missed devirtualization seen in the attached testcase.
> (shamelessly stolen from the testsuite).
please generate your patches with the -p switch, this one is short but
often I get lost rather easily without it.
>
...
> Index: gimplify.c
> ===================================================================
> --- gimplify.c (revision 164344)
> +++ gimplify.c (working copy)
> @@ -2479,8 +2479,11 @@
> {
> /* 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. */
> + gimple_stmt_iterator gsi;
> 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;
> }
I have just checked and we fold the OBJ_TYPE_REF even at -O0, is that
something we want to do?
Thanks,
Martin