comparison gcc/ipa-inline.c @ 122:fb3d53c41846

do not expand code segment
author mir3636
date Thu, 22 Mar 2018 17:37:58 +0900
parents 04ced10e8804
children ab229f40eab2
comparison
equal deleted inserted replaced
121:49957f95a4d1 122:fb3d53c41846
118 #include "builtins.h" 118 #include "builtins.h"
119 #include "fibonacci_heap.h" 119 #include "fibonacci_heap.h"
120 #include "stringpool.h" 120 #include "stringpool.h"
121 #include "attribs.h" 121 #include "attribs.h"
122 #include "asan.h" 122 #include "asan.h"
123 #include "c/cbc-tree.h"
123 124
124 typedef fibonacci_heap <sreal, cgraph_edge> edge_heap_t; 125 typedef fibonacci_heap <sreal, cgraph_edge> edge_heap_t;
125 typedef fibonacci_node <sreal, cgraph_edge> edge_heap_node_t; 126 typedef fibonacci_node <sreal, cgraph_edge> edge_heap_node_t;
126 127
127 /* Statistics we collect about inlining algorithm. */ 128 /* Statistics we collect about inlining algorithm. */
2201 fprintf (dump_file, 2202 fprintf (dump_file,
2202 " Called once from %s %i insns.\n", 2203 " Called once from %s %i insns.\n",
2203 node->callers->caller->name (), 2204 node->callers->caller->name (),
2204 ipa_fn_summaries->get (node->callers->caller)->size); 2205 ipa_fn_summaries->get (node->callers->caller)->size);
2205 } 2206 }
2207 #ifndef noCbC
2208 /* tail call flag is not valid when a code segment is inlined in a normal function.
2209 do not expand the call. */
2210 tree from = caller->decl;
2211 if (node->callees && node->callees->callee) {
2212 tree to = node->callees->callee->decl;
2213 if (CbC_IS_CODE_SEGMENT (TREE_TYPE (to)) && !CbC_IS_CODE_SEGMENT (TREE_TYPE (from)))
2214 continue;
2215 }
2216 #endif
2206 2217
2207 /* Remember which callers we inlined to, delaying updating the 2218 /* Remember which callers we inlined to, delaying updating the
2208 overall summary. */ 2219 overall summary. */
2209 callers->add (node->callers->caller); 2220 callers->add (node->callers->caller);
2210 inline_call (node->callers, true, NULL, NULL, false, &callee_removed); 2221 inline_call (node->callers, true, NULL, NULL, false, &callee_removed);