On Tue, Mar 18, 2014 at 1:38 PM, Martin Liška <mli...@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 <mli...@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 > >