comparison gcc/ipa-inline.c @ 123:ab229f40eab2

fix inline_call
author mir3636
date Fri, 30 Mar 2018 22:58:55 +0900
parents fb3d53c41846
children c3a50d7877e8
comparison
equal deleted inserted replaced
122:fb3d53c41846 123:ab229f40eab2
2177 inline_to_all_callers_1 (struct cgraph_node *node, void *data, 2177 inline_to_all_callers_1 (struct cgraph_node *node, void *data,
2178 hash_set<cgraph_node *> *callers) 2178 hash_set<cgraph_node *> *callers)
2179 { 2179 {
2180 int *num_calls = (int *)data; 2180 int *num_calls = (int *)data;
2181 bool callee_removed = false; 2181 bool callee_removed = false;
2182 2182 #ifndef noCbC
2183 while (node->callers && !node->global.inlined_to && !node->callers->call_stmt->vdef)
2184 {
2185 #else
2183 while (node->callers && !node->global.inlined_to) 2186 while (node->callers && !node->global.inlined_to)
2184 { 2187 {
2188 #endif
2185 struct cgraph_node *caller = node->callers->caller; 2189 struct cgraph_node *caller = node->callers->caller;
2186 2190
2187 if (!can_inline_edge_p (node->callers, true) 2191 if (!can_inline_edge_p (node->callers, true)
2188 || node->callers->recursive_p ()) 2192 || node->callers->recursive_p ())
2189 { 2193 {
2202 fprintf (dump_file, 2206 fprintf (dump_file,
2203 " Called once from %s %i insns.\n", 2207 " Called once from %s %i insns.\n",
2204 node->callers->caller->name (), 2208 node->callers->caller->name (),
2205 ipa_fn_summaries->get (node->callers->caller)->size); 2209 ipa_fn_summaries->get (node->callers->caller)->size);
2206 } 2210 }
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
2217
2218 /* Remember which callers we inlined to, delaying updating the 2211 /* Remember which callers we inlined to, delaying updating the
2219 overall summary. */ 2212 overall summary. */
2220 callers->add (node->callers->caller); 2213 callers->add (node->callers->caller);
2221 inline_call (node->callers, true, NULL, NULL, false, &callee_removed); 2214 inline_call (node->callers, true, NULL, NULL, false, &callee_removed);
2222 if (dump_file) 2215 if (dump_file)