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] Update callgraph edges if fold_marked_statements folds some CALL_EXPR (PR middle-end/34969)


> 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


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