This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Update callgraph edges if fold_marked_statements folds some CALL_EXPR (PR middle-end/34969)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 29 Jan 2008 18:58:00 +0100
- Subject: Re: [PATCH] Update callgraph edges if fold_marked_statements folds some CALL_EXPR (PR middle-end/34969)
- References: <20080129132846.GM30691@devserv.devel.redhat.com>
> 2008-01-29 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/34969
> * cgraph.h (cgraph_update_edges_for_call_stmt): New prototype.
> * cgraph.c (cgraph_update_edges_for_call_stmt): New function.
> * tree-inline.c (fold_marked_statements): Call
> cgraph_update_edges_for_call_stmt if folding a call statement.
> * cgraphunit.c (verify_cgraph_node): Set cfun to this_cfun for
> debug_generic_stmt calls, reset it back afterwards.
>
> * gcc.dg/pr34969.c: New test.
>
> + ne = cgraph_create_edge (node, cgraph_node (new_decl),
> + new_stmt, e->count, e->frequency,
> + e->loop_nest);
> + ne->inline_failed = e->inline_failed;
When we change one call to completely different call, I don't think it
is safe to keep decision to inline it: the new call might not be
inlinable at all. Perhaps having gcc_assert that inline_failed is always
set would help to prevent later surprises.
Otherwise patch is OK, thanks a lot for working on this!
Honza