This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix gimple-fold
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin LiÅka <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Mar 2014 14:07:59 +0100
- Subject: Re: [PATCH] Fix gimple-fold
- Authentication-results: sourceware.org; auth=none
- References: <53283E3B dot 4050700 at suse dot cz>
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
>
>