# HG changeset patch # User mir3636 # Date 1521707878 -32400 # Node ID fb3d53c41846ab2884daa98d035f9237319dc9eb # Parent 49957f95a4d1bc6968e208a662ccd8095bded37e do not expand code segment diff -r 49957f95a4d1 -r fb3d53c41846 gcc/ipa-inline.c --- a/gcc/ipa-inline.c Fri Mar 09 19:18:14 2018 +0900 +++ b/gcc/ipa-inline.c Thu Mar 22 17:37:58 2018 +0900 @@ -120,6 +120,7 @@ #include "stringpool.h" #include "attribs.h" #include "asan.h" +#include "c/cbc-tree.h" typedef fibonacci_heap edge_heap_t; typedef fibonacci_node edge_heap_node_t; @@ -2203,6 +2204,16 @@ node->callers->caller->name (), ipa_fn_summaries->get (node->callers->caller)->size); } +#ifndef noCbC + /* tail call flag is not valid when a code segment is inlined in a normal function. + do not expand the call. */ + tree from = caller->decl; + if (node->callees && node->callees->callee) { + tree to = node->callees->callee->decl; + if (CbC_IS_CODE_SEGMENT (TREE_TYPE (to)) && !CbC_IS_CODE_SEGMENT (TREE_TYPE (from))) + continue; + } +#endif /* Remember which callers we inlined to, delaying updating the overall summary. */