[Bug c++/45605] Missed devirtualization

jamborm at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Sep 16 16:00:00 GMT 2010



------- 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?

> 
> 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.

Thanks,  Martin


-- 

jamborm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-09-16 12:25:30         |2010-09-16 16:00:08
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45605



More information about the Gcc-bugs mailing list