Hi, this patch fixes ICE when thunk is inlined and call within thunk too. We need to recurse in this case because inlining thunk does not introduce a new basic blocks like normal inlining does.
Bootstrapped/regtested x86_64-linux, comitted. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 236272) +++ ChangeLog (working copy) @@ -1,5 +1,9 @@ 2016-05-16 Jan Hubicka <hubi...@ucw.cz> + * tree-inline.c (expand_call_inline): recurse after inlining thunk. + +2016-05-16 Jan Hubicka <hubi...@ucw.cz> + * tree.c (free_lang_data_in_decl): Also set target/optimization flags for thunks. Index: tree-inline.c =================================================================== --- tree-inline.c (revision 236269) +++ tree-inline.c (working copy) @@ -4485,6 +4485,7 @@ expand_call_inline (basic_block bb, gimp gimple_call_set_fndecl (stmt, edge->callee->decl); update_stmt (stmt); id->src_node->remove (); + expand_call_inline (bb, stmt, id); return true; } fn = cg_edge->callee->decl;