This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix gimple-fold


On Tue, Mar 18, 2014 at 1:38 PM, Martin LiÅka <mliska@suse.cz> wrote:
> Hello,
>     I found ICE in Chromium compiled with LTO. There's a call that is proved
> by ipa-devirt as __builtin_unreachable; same decision is done by gimple-fold
> and this call is replaced by GIMPLE_CALL and GIMPLE_ASSIGN (in this order).
> After that condition for cgraph_update_edges_for_call_stmt_node is not
> satisfied and corresponding cgraph_edge is not updated. Thus a verifier
> reports a wrong edge.

You should be able to simply do

  update_call_from_tree (gsi, def);
  gsi_insert_before (gsi, new_stmt, GSI_NEW_STMT);

also cgraph_edge (node, old_stmt) is already computed in 'e' AFAICS.

Richard.

> Bootstrapped and tested on a x86_64 machine.
>
>
> Changelog:
> 2014-03-18  Martin Liska  <mliska@suse.cz>
>
>         * cgraph.c (cgraph_update_edges_for_call_stmt_node): added case when
>         gimple call statement is updated.
>         * gimple-fold.c (gimple_fold_call): changed order for GIMPLE_ASSIGN
> and
>         GIMPLE_CALL, where gsi iterator still points to GIMPLE CALL.
>
> OK for trunk?
>
> Thank you,
> Martin
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]