* sv.po: Update.
[official-gcc.git] / gcc / cp / optimize.c
blob6f80b3d6d842c8616477391bf8c0d3775ef101b8
1 /* Perform optimizations on tree structure.
2 Copyright (C) 1998-2016 Free Software Foundation, Inc.
3 Written by Mark Michell (mark@codesourcery.com).
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "target.h"
25 #include "cp-tree.h"
26 #include "stringpool.h"
27 #include "cgraph.h"
28 #include "debug.h"
29 #include "tree-inline.h"
30 #include "tree-iterator.h"
32 /* Prototypes. */
34 static void update_cloned_parm (tree, tree, bool);
36 /* CLONED_PARM is a copy of CLONE, generated for a cloned constructor
37 or destructor. Update it to ensure that the source-position for
38 the cloned parameter matches that for the original, and that the
39 debugging generation code will be able to find the original PARM. */
41 static void
42 update_cloned_parm (tree parm, tree cloned_parm, bool first)
44 DECL_ABSTRACT_ORIGIN (cloned_parm) = parm;
46 /* We may have taken its address. */
47 TREE_ADDRESSABLE (cloned_parm) = TREE_ADDRESSABLE (parm);
49 /* The definition might have different constness. */
50 TREE_READONLY (cloned_parm) = TREE_READONLY (parm);
52 TREE_USED (cloned_parm) = !first || TREE_USED (parm);
54 /* The name may have changed from the declaration. */
55 DECL_NAME (cloned_parm) = DECL_NAME (parm);
56 DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm);
57 TREE_TYPE (cloned_parm) = TREE_TYPE (parm);
59 DECL_GIMPLE_REG_P (cloned_parm) = DECL_GIMPLE_REG_P (parm);
63 /* FN is a function in High GIMPLE form that has a complete body and no
64 CFG. CLONE is a function whose body is to be set to a copy of FN,
65 mapping argument declarations according to the ARG_MAP splay_tree. */
67 static void
68 clone_body (tree clone, tree fn, void *arg_map)
70 copy_body_data id;
71 tree stmts;
73 /* Clone the body, as if we were making an inline call. But, remap
74 the parameters in the callee to the parameters of caller. */
75 memset (&id, 0, sizeof (id));
76 id.src_fn = fn;
77 id.dst_fn = clone;
78 id.src_cfun = DECL_STRUCT_FUNCTION (fn);
79 id.decl_map = static_cast<hash_map<tree, tree> *> (arg_map);
81 id.copy_decl = copy_decl_no_change;
82 id.transform_call_graph_edges = CB_CGE_DUPLICATE;
83 id.transform_new_cfg = true;
84 id.transform_return_to_modify = false;
85 id.transform_lang_insert_block = NULL;
87 /* We're not inside any EH region. */
88 id.eh_lp_nr = 0;
90 stmts = DECL_SAVED_TREE (fn);
91 walk_tree (&stmts, copy_tree_body_r, &id, NULL);
93 /* Also remap the initializer of any static variables so that they (in
94 particular, any label addresses) correspond to the base variant rather
95 than the abstract one. */
96 if (DECL_NAME (clone) == base_dtor_identifier
97 || DECL_NAME (clone) == base_ctor_identifier)
99 unsigned ix;
100 tree decl;
102 FOR_EACH_LOCAL_DECL (DECL_STRUCT_FUNCTION (fn), ix, decl)
103 walk_tree (&DECL_INITIAL (decl), copy_tree_body_r, &id, NULL);
106 append_to_statement_list_force (stmts, &DECL_SAVED_TREE (clone));
109 /* DELETE_DTOR is a delete destructor whose body will be built.
110 COMPLETE_DTOR is the corresponding complete destructor. */
112 static void
113 build_delete_destructor_body (tree delete_dtor, tree complete_dtor)
115 tree call_dtor, call_delete;
116 tree parm = DECL_ARGUMENTS (delete_dtor);
117 tree virtual_size = cxx_sizeof (current_class_type);
119 /* Call the corresponding complete destructor. */
120 gcc_assert (complete_dtor);
121 call_dtor = build_cxx_call (complete_dtor, 1, &parm,
122 tf_warning_or_error);
123 add_stmt (call_dtor);
125 add_stmt (build_stmt (0, LABEL_EXPR, cdtor_label));
127 /* Call the delete function. */
128 call_delete = build_op_delete_call (DELETE_EXPR, current_class_ptr,
129 virtual_size,
130 /*global_p=*/false,
131 /*placement=*/NULL_TREE,
132 /*alloc_fn=*/NULL_TREE,
133 tf_warning_or_error);
134 add_stmt (call_delete);
136 /* Return the address of the object. */
137 if (targetm.cxx.cdtor_returns_this ())
139 tree val = DECL_ARGUMENTS (delete_dtor);
140 val = build2 (MODIFY_EXPR, TREE_TYPE (val),
141 DECL_RESULT (delete_dtor), val);
142 add_stmt (build_stmt (0, RETURN_EXPR, val));
146 /* Return name of comdat group for complete and base ctor (or dtor)
147 that have the same body. If dtor is virtual, deleting dtor goes
148 into this comdat group as well. */
150 static tree
151 cdtor_comdat_group (tree complete, tree base)
153 tree complete_name = DECL_ASSEMBLER_NAME (complete);
154 tree base_name = DECL_ASSEMBLER_NAME (base);
155 char *grp_name;
156 const char *p, *q;
157 bool diff_seen = false;
158 size_t idx;
159 gcc_assert (IDENTIFIER_LENGTH (complete_name)
160 == IDENTIFIER_LENGTH (base_name));
161 grp_name = XALLOCAVEC (char, IDENTIFIER_LENGTH (complete_name) + 1);
162 p = IDENTIFIER_POINTER (complete_name);
163 q = IDENTIFIER_POINTER (base_name);
164 for (idx = 0; idx < IDENTIFIER_LENGTH (complete_name); idx++)
165 if (p[idx] == q[idx])
166 grp_name[idx] = p[idx];
167 else
169 gcc_assert (!diff_seen
170 && idx > 0
171 && (p[idx - 1] == 'C' || p[idx - 1] == 'D')
172 && p[idx] == '1'
173 && q[idx] == '2');
174 grp_name[idx] = '5';
175 diff_seen = true;
177 grp_name[idx] = '\0';
178 gcc_assert (diff_seen);
179 return get_identifier (grp_name);
182 /* Returns true iff we can make the base and complete [cd]tor aliases of
183 the same symbol rather than separate functions. */
185 static bool
186 can_alias_cdtor (tree fn)
188 #ifndef ASM_OUTPUT_DEF
189 /* If aliases aren't supported by the assembler, fail. */
190 return false;
191 #endif
192 /* We can't use an alias if there are virtual bases. */
193 if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn)))
194 return false;
195 /* ??? Why not use aliases with -frepo? */
196 if (flag_use_repository)
197 return false;
198 gcc_assert (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)
199 || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn));
200 /* Don't use aliases for weak/linkonce definitions unless we can put both
201 symbols in the same COMDAT group. */
202 return (DECL_INTERFACE_KNOWN (fn)
203 && (SUPPORTS_ONE_ONLY || !DECL_WEAK (fn))
204 && (!DECL_ONE_ONLY (fn)
205 || (HAVE_COMDAT_GROUP && DECL_WEAK (fn))));
208 /* FN is a [cd]tor, fns is a pointer to an array of length 3. Fill fns
209 with pointers to the base, complete, and deleting variants. */
211 static void
212 populate_clone_array (tree fn, tree *fns)
214 tree clone;
216 fns[0] = NULL_TREE;
217 fns[1] = NULL_TREE;
218 fns[2] = NULL_TREE;
220 /* Look for the complete destructor which may be used to build the
221 delete destructor. */
222 FOR_EACH_CLONE (clone, fn)
223 if (DECL_NAME (clone) == complete_dtor_identifier
224 || DECL_NAME (clone) == complete_ctor_identifier)
225 fns[1] = clone;
226 else if (DECL_NAME (clone) == base_dtor_identifier
227 || DECL_NAME (clone) == base_ctor_identifier)
228 fns[0] = clone;
229 else if (DECL_NAME (clone) == deleting_dtor_identifier)
230 fns[2] = clone;
231 else
232 gcc_unreachable ();
235 /* FN is a constructor or destructor, and there are FUNCTION_DECLs
236 cloned from it nearby. Instead of cloning this body, leave it
237 alone and create tiny one-call bodies for the cloned
238 FUNCTION_DECLs. These clones are sibcall candidates, and their
239 resulting code will be very thunk-esque. */
241 static bool
242 maybe_thunk_body (tree fn, bool force)
244 tree bind, block, call, clone, clone_result, fn_parm, fn_parm_typelist;
245 tree last_arg, modify, *args;
246 int parmno, vtt_parmno, max_parms;
247 tree fns[3];
249 if (!force && !flag_declone_ctor_dtor)
250 return 0;
252 /* If function accepts variable arguments, give up. */
253 last_arg = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fn)));
254 if (last_arg != void_list_node)
255 return 0;
257 /* If we got this far, we've decided to turn the clones into thunks. */
259 /* We're going to generate code for fn, so it is no longer "abstract."
260 Also make the unified ctor/dtor private to either the translation unit
261 (for non-vague linkage ctors) or the COMDAT group (otherwise). */
263 populate_clone_array (fn, fns);
264 DECL_ABSTRACT_P (fn) = false;
265 if (!DECL_WEAK (fn))
267 TREE_PUBLIC (fn) = false;
268 DECL_EXTERNAL (fn) = false;
269 DECL_INTERFACE_KNOWN (fn) = true;
271 else if (HAVE_COMDAT_GROUP)
273 /* At eof, defer creation of mangling aliases temporarily. */
274 bool save_defer_mangling_aliases = defer_mangling_aliases;
275 defer_mangling_aliases = true;
276 tree comdat_group = cdtor_comdat_group (fns[1], fns[0]);
277 defer_mangling_aliases = save_defer_mangling_aliases;
278 cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group);
279 cgraph_node::get_create (fns[1])->add_to_same_comdat_group
280 (cgraph_node::get_create (fns[0]));
281 symtab_node::get (fn)->add_to_same_comdat_group
282 (symtab_node::get (fns[0]));
283 if (fns[2])
284 /* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is
285 virtual, it goes into the same comdat group as well. */
286 cgraph_node::get_create (fns[2])->add_to_same_comdat_group
287 (symtab_node::get (fns[0]));
288 /* Emit them now that the thunks are same comdat group aliases. */
289 if (!save_defer_mangling_aliases)
290 generate_mangling_aliases ();
291 TREE_PUBLIC (fn) = false;
292 DECL_EXTERNAL (fn) = false;
293 DECL_INTERFACE_KNOWN (fn) = true;
294 /* function_and_variable_visibility doesn't want !PUBLIC decls to
295 have these flags set. */
296 DECL_WEAK (fn) = false;
297 DECL_COMDAT (fn) = false;
300 /* Find the vtt_parm, if present. */
301 for (vtt_parmno = -1, parmno = 0, fn_parm = DECL_ARGUMENTS (fn);
302 fn_parm;
303 ++parmno, fn_parm = TREE_CHAIN (fn_parm))
305 if (DECL_ARTIFICIAL (fn_parm)
306 && DECL_NAME (fn_parm) == vtt_parm_identifier)
308 /* Compensate for removed in_charge parameter. */
309 vtt_parmno = parmno;
310 break;
314 /* Allocate an argument buffer for build_cxx_call().
315 Make sure it is large enough for any of the clones. */
316 max_parms = 0;
317 FOR_EACH_CLONE (clone, fn)
319 int length = list_length (DECL_ARGUMENTS (fn));
320 if (length > max_parms)
321 max_parms = length;
323 args = (tree *) alloca (max_parms * sizeof (tree));
325 /* We know that any clones immediately follow FN in TYPE_METHODS. */
326 FOR_EACH_CLONE (clone, fn)
328 tree clone_parm;
330 /* If we've already generated a body for this clone, avoid
331 duplicating it. (Is it possible for a clone-list to grow after we
332 first see it?) */
333 if (DECL_SAVED_TREE (clone) || TREE_ASM_WRITTEN (clone))
334 continue;
336 /* Start processing the function. */
337 start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED);
339 if (clone == fns[2])
341 for (clone_parm = DECL_ARGUMENTS (clone); clone_parm;
342 clone_parm = TREE_CHAIN (clone_parm))
343 DECL_ABSTRACT_ORIGIN (clone_parm) = NULL_TREE;
344 /* Build the delete destructor by calling complete destructor and
345 delete function. */
346 build_delete_destructor_body (clone, fns[1]);
348 else
350 /* Walk parameter lists together, creating parameter list for
351 call to original function. */
352 for (parmno = 0,
353 fn_parm = DECL_ARGUMENTS (fn),
354 fn_parm_typelist = TYPE_ARG_TYPES (TREE_TYPE (fn)),
355 clone_parm = DECL_ARGUMENTS (clone);
356 fn_parm;
357 ++parmno,
358 fn_parm = TREE_CHAIN (fn_parm))
360 if (parmno == vtt_parmno && ! DECL_HAS_VTT_PARM_P (clone))
362 gcc_assert (fn_parm_typelist);
363 /* Clobber argument with formal parameter type. */
364 args[parmno]
365 = convert (TREE_VALUE (fn_parm_typelist),
366 null_pointer_node);
368 else if (parmno == 1 && DECL_HAS_IN_CHARGE_PARM_P (fn))
370 tree in_charge
371 = copy_node (in_charge_arg_for_name (DECL_NAME (clone)));
372 args[parmno] = in_charge;
374 /* Map other parameters to their equivalents in the cloned
375 function. */
376 else
378 gcc_assert (clone_parm);
379 DECL_ABSTRACT_ORIGIN (clone_parm) = NULL;
380 args[parmno] = clone_parm;
381 clone_parm = TREE_CHAIN (clone_parm);
383 if (fn_parm_typelist)
384 fn_parm_typelist = TREE_CHAIN (fn_parm_typelist);
387 /* We built this list backwards; fix now. */
388 mark_used (fn);
389 call = build_cxx_call (fn, parmno, args, tf_warning_or_error);
390 /* Arguments passed to the thunk by invisible reference should
391 be transmitted to the callee unchanged. Do not create a
392 temporary and invoke the copy constructor. The thunking
393 transformation must not introduce any constructor calls. */
394 CALL_FROM_THUNK_P (call) = 1;
395 block = make_node (BLOCK);
396 if (targetm.cxx.cdtor_returns_this ())
398 clone_result = DECL_RESULT (clone);
399 modify = build2 (MODIFY_EXPR, TREE_TYPE (clone_result),
400 clone_result, call);
401 modify = build1 (RETURN_EXPR, void_type_node, modify);
402 add_stmt (modify);
404 else
406 add_stmt (call);
408 bind = c_build_bind_expr (DECL_SOURCE_LOCATION (clone),
409 block, cur_stmt_list);
410 DECL_SAVED_TREE (clone) = push_stmt_list ();
411 add_stmt (bind);
414 DECL_ABSTRACT_ORIGIN (clone) = NULL;
415 expand_or_defer_fn (finish_function (0));
417 return 1;
420 /* FN is a function that has a complete body. Clone the body as
421 necessary. Returns nonzero if there's no longer any need to
422 process the main body. */
424 bool
425 maybe_clone_body (tree fn)
427 tree comdat_group = NULL_TREE;
428 tree clone;
429 tree fns[3];
430 bool first = true;
431 int idx;
432 bool need_alias = false;
434 /* We only clone constructors and destructors. */
435 if (!DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)
436 && !DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn))
437 return 0;
439 populate_clone_array (fn, fns);
441 /* Remember if we can't have multiple clones for some reason. We need to
442 check this before we remap local static initializers in clone_body. */
443 if (!tree_versionable_function_p (fn))
444 need_alias = true;
446 /* We know that any clones immediately follow FN in the TYPE_METHODS
447 list. */
448 push_to_top_level ();
449 for (idx = 0; idx < 3; idx++)
451 tree parm;
452 tree clone_parm;
454 clone = fns[idx];
455 if (!clone)
456 continue;
458 /* Update CLONE's source position information to match FN's. */
459 DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
460 DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
461 DECL_DECLARED_CONSTEXPR_P (clone) = DECL_DECLARED_CONSTEXPR_P (fn);
462 DECL_COMDAT (clone) = DECL_COMDAT (fn);
463 DECL_WEAK (clone) = DECL_WEAK (fn);
465 /* We don't copy the comdat group from fn to clone because the assembler
466 name of fn was corrupted by write_mangled_name by adding *INTERNAL*
467 to it. By doing so, it also corrupted the comdat group. */
468 if (DECL_ONE_ONLY (fn))
469 cgraph_node::get_create (clone)->set_comdat_group (cxx_comdat_group (clone));
470 DECL_USE_TEMPLATE (clone) = DECL_USE_TEMPLATE (fn);
471 DECL_EXTERNAL (clone) = DECL_EXTERNAL (fn);
472 DECL_INTERFACE_KNOWN (clone) = DECL_INTERFACE_KNOWN (fn);
473 DECL_NOT_REALLY_EXTERN (clone) = DECL_NOT_REALLY_EXTERN (fn);
474 TREE_PUBLIC (clone) = TREE_PUBLIC (fn);
475 DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn);
476 DECL_VISIBILITY_SPECIFIED (clone) = DECL_VISIBILITY_SPECIFIED (fn);
477 DECL_DLLIMPORT_P (clone) = DECL_DLLIMPORT_P (fn);
478 DECL_ATTRIBUTES (clone) = copy_list (DECL_ATTRIBUTES (fn));
479 DECL_DISREGARD_INLINE_LIMITS (clone) = DECL_DISREGARD_INLINE_LIMITS (fn);
480 set_decl_section_name (clone, DECL_SECTION_NAME (fn));
482 /* Adjust the parameter names and locations. */
483 parm = DECL_ARGUMENTS (fn);
484 clone_parm = DECL_ARGUMENTS (clone);
485 /* Update the `this' parameter, which is always first. */
486 update_cloned_parm (parm, clone_parm, first);
487 parm = DECL_CHAIN (parm);
488 clone_parm = DECL_CHAIN (clone_parm);
489 if (DECL_HAS_IN_CHARGE_PARM_P (fn))
490 parm = DECL_CHAIN (parm);
491 if (DECL_HAS_VTT_PARM_P (fn))
492 parm = DECL_CHAIN (parm);
493 if (DECL_HAS_VTT_PARM_P (clone))
494 clone_parm = DECL_CHAIN (clone_parm);
495 for (; parm;
496 parm = DECL_CHAIN (parm), clone_parm = DECL_CHAIN (clone_parm))
497 /* Update this parameter. */
498 update_cloned_parm (parm, clone_parm, first);
501 bool can_alias = can_alias_cdtor (fn);
503 /* If we decide to turn clones into thunks, they will branch to fn.
504 Must have original function available to call. */
505 if (!can_alias && maybe_thunk_body (fn, need_alias))
507 pop_from_top_level ();
508 /* We still need to emit the original function. */
509 return 0;
512 /* Emit the DWARF1 abstract instance. */
513 (*debug_hooks->deferred_inline_function) (fn);
515 /* We know that any clones immediately follow FN in the TYPE_METHODS list. */
516 for (idx = 0; idx < 3; idx++)
518 tree parm;
519 tree clone_parm;
520 int parmno;
521 hash_map<tree, tree> *decl_map;
522 bool alias = false;
524 clone = fns[idx];
525 if (!clone)
526 continue;
528 /* Start processing the function. */
529 start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED);
531 /* Tell cgraph if both ctors or both dtors are known to have
532 the same body. */
533 if (can_alias
534 && fns[0]
535 && idx == 1
536 && cgraph_node::get_create (fns[0])->create_same_body_alias
537 (clone, fns[0]))
539 alias = true;
540 if (DECL_ONE_ONLY (fns[0]))
542 /* For comdat base and complete cdtors put them
543 into the same, *[CD]5* comdat group instead of
544 *[CD][12]*. */
545 comdat_group = cdtor_comdat_group (fns[1], fns[0]);
546 cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group);
547 if (symtab_node::get (clone)->same_comdat_group)
548 symtab_node::get (clone)->remove_from_same_comdat_group ();
549 symtab_node::get (clone)->add_to_same_comdat_group
550 (symtab_node::get (fns[0]));
554 /* Build the delete destructor by calling complete destructor
555 and delete function. */
556 if (idx == 2)
558 build_delete_destructor_body (clone, fns[1]);
559 /* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is
560 virtual, it goes into the same comdat group as well. */
561 if (comdat_group)
562 cgraph_node::get_create (clone)->add_to_same_comdat_group
563 (symtab_node::get (fns[0]));
565 else if (alias)
566 /* No need to populate body. */ ;
567 else
569 /* If we can't have multiple copies of FN (say, because there's a
570 static local initialized with the address of a label), we need
571 to use an alias for the complete variant. */
572 if (idx == 1 && need_alias)
574 if (DECL_STRUCT_FUNCTION (fn)->cannot_be_copied_set)
575 sorry (DECL_STRUCT_FUNCTION (fn)->cannot_be_copied_reason, fn);
576 else
577 sorry ("making multiple clones of %qD", fn);
580 /* Remap the parameters. */
581 decl_map = new hash_map<tree, tree>;
582 for (parmno = 0,
583 parm = DECL_ARGUMENTS (fn),
584 clone_parm = DECL_ARGUMENTS (clone);
585 parm;
586 ++parmno,
587 parm = DECL_CHAIN (parm))
589 /* Map the in-charge parameter to an appropriate constant. */
590 if (DECL_HAS_IN_CHARGE_PARM_P (fn) && parmno == 1)
592 tree in_charge;
593 in_charge = in_charge_arg_for_name (DECL_NAME (clone));
594 decl_map->put (parm, in_charge);
596 else if (DECL_ARTIFICIAL (parm)
597 && DECL_NAME (parm) == vtt_parm_identifier)
599 /* For a subobject constructor or destructor, the next
600 argument is the VTT parameter. Remap the VTT_PARM
601 from the CLONE to this parameter. */
602 if (DECL_HAS_VTT_PARM_P (clone))
604 DECL_ABSTRACT_ORIGIN (clone_parm) = parm;
605 decl_map->put (parm, clone_parm);
606 clone_parm = DECL_CHAIN (clone_parm);
608 /* Otherwise, map the VTT parameter to `NULL'. */
609 else
611 tree t
612 = fold_convert (TREE_TYPE (parm), null_pointer_node);
613 decl_map->put (parm, t);
616 /* Map other parameters to their equivalents in the cloned
617 function. */
618 else
620 decl_map->put (parm, clone_parm);
621 clone_parm = DECL_CHAIN (clone_parm);
625 if (targetm.cxx.cdtor_returns_this ())
627 parm = DECL_RESULT (fn);
628 clone_parm = DECL_RESULT (clone);
629 decl_map->put (parm, clone_parm);
632 /* Clone the body. */
633 clone_body (clone, fn, decl_map);
635 /* Clean up. */
636 delete decl_map;
639 /* The clone can throw iff the original function can throw. */
640 cp_function_chain->can_throw = !TREE_NOTHROW (fn);
642 /* Now, expand this function into RTL, if appropriate. */
643 finish_function (0);
644 BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn);
645 if (alias)
647 if (expand_or_defer_fn_1 (clone))
648 emit_associated_thunks (clone);
649 /* We didn't generate a body, so remove the empty one. */
650 DECL_SAVED_TREE (clone) = NULL_TREE;
652 else
653 expand_or_defer_fn (clone);
654 first = false;
656 pop_from_top_level ();
658 /* We don't need to process the original function any further. */
659 return 1;