On 9/30/19 3:30 AM, Martin Jambor wrote:
> Hi,
> 
> when looking into PR 70929 and thus looking at what
> gimple_check_call_matching_types and gimple_check_call_args (both in
> cgraph.c) do, I noticed that they get invoked a lot when cloning cgraph
> edges when code is being copied as part of inlining transformation, only
> to have their result overwritten by the value from the original edge.
> (They also fail a lot during that time because since call redirection has
> not taken place yet, the arguments are actually expected not to match.)
> 
> The following patch avoids that by adding a simple parameter to various
> create_edge methods which indicate that we are cloning and the call
> statement should therefore not be examined.  For consistency reasons I
> unfortunately also had to change the meaning of the last parameter of
> create_indirect_edge but there is only one place where it is called with
> value of the parameter specified and its intent has always been to
> behave differently when cloning.
> 
> Bootstrapped and tested on x86_64-linux.  OK for trunk?
> 
> Thanks,
> 
> Martin
> 
> 
> 
> 2019-09-27  Martin Jambor  <mjam...@suse.cz>
> 
>       * cgraph.c (symbol_table::create_edge): New parameter cloning_p,
>       do not compute some stuff when set.
>       (cgraph_node::create_edge): Likewise.
>       (cgraph_node::create_indirect_edge): Renamed last parameter to
>       coning_p and flipped its meaning, don't even calculate
>       inline_failed when set.
>       * cgraph.h (cgraph_node::create_edge): Add new parameter.
>       (symbol_table::::create_edge): Likewise.
>       (cgraph_node::create_indirect_edge): Rename last parameter, flip
>       the default value.
>       * cgraphclones.c (cgraph_edge::clone): Pass true cloning_p to all
>       call graph edge creating functions.
OK
jeff
> ---

Reply via email to