aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-09-28 21:20:53 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-09-28 21:20:53 +0000
commit44662f681e8be6b3b7eafcec4afa0ecb8cc587cd (patch)
tree1c0470d4d2c3d3ea333d09879f17a86087934d93 /gcc/cp
parent5c441345a343d0ef90e5ac9ef95039030ecef1ee (diff)
downloadgcc-44662f681e8be6b3b7eafcec4afa0ecb8cc587cd.zip
gcc-44662f681e8be6b3b7eafcec4afa0ecb8cc587cd.tar.gz
gcc-44662f681e8be6b3b7eafcec4afa0ecb8cc587cd.tar.bz2
calls.c (expand_call): Try to do a tail call for thunks at -O0 too.
* calls.c (expand_call): Try to do a tail call for thunks at -O0 too. * cgraph.h (struct cgraph_thunk_info): Add indirect_offset. (cgraph_node::create_thunk): Add indirect_offset parameter. (thunk_adjust): Likewise. * cgraph.c (cgraph_node::create_thunk): Add indirect_offset parameter and initialize the corresponding field with it. (cgraph_node::dump): Dump indirect_offset field. * cgraphclones.c (duplicate_thunk_for_node): Deal with indirect_offset. * cgraphunit.c (cgraph_node::analyze): Be prepared for external thunks. (thunk_adjust): Add indirect_offset parameter and deal with it. (cgraph_node::expand_thunk): Deal with the indirect_offset field and pass it to thunk_adjust. Do not call the target hook if it's non-zero or if the thunk is external or local. Fix formatting. Do not chain the RESULT_DECL to BLOCK_VARS. Pass the static chain to the target, if any, in the GIMPLE representation. * ipa-icf.c (sem_function::equals_wpa): Deal with indirect_offset. * lto-cgraph.c (lto_output_node): Write indirect_offset field. (input_node): Read indirect_offset field. * tree-inline.c (expand_call_inline): Pass indirect_offset field in the call to thunk_adjust. * tree-nested.c (struct nesting_info): Add thunk_p field. (create_nesting_tree): Set it. (convert_all_function_calls): Copy static chain from targets to thunks. (finalize_nesting_tree_1): Return early for thunks. (unnest_nesting_tree_1): Do not finalize thunks. (gimplify_all_functions): Do not gimplify thunks. cp/ * method.c (use_thunk): Adjust call to cgraph_node::create_thunk. ada/ * gcc-interface/decl.c (is_cplusplus_method): Do not require C++ convention on Interfaces. * gcc-interface/trans.c (Subprogram_Body_to_gnu): Try to create a bona-fide thunk and hand it over to the middle-end. (get_controlling_type): New function. (use_alias_for_thunk_p): Likewise. (thunk_labelno): New static variable. (make_covariant_thunk): New function. (maybe_make_gnu_thunk): Likewise. * gcc-interface/utils.c (finish_subprog_decl): Set DECL_CONTEXT of the result DECL here instead of... (end_subprog_body): ...here. Co-Authored-By: Pierre-Marie de Rodat <derodat@adacore.com> From-SVN: r264701
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/method.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f5d602d..e10ada2d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-28 Eric Botcazou <ebotcazou@adacore.com>
+ Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * method.c (use_thunk): Adjust call to cgraph_node::create_thunk.
+
2018-09-28 Richard Biener <rguenther@suse.de>
* error.c (cp_print_error_function): Simplify by eliding
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 5379b4d..2de2d10 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -375,7 +375,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
gcc_checking_assert (funcn);
thunk_node = funcn->create_thunk (thunk_fndecl, function,
this_adjusting, fixed_offset, virtual_value,
- virtual_offset, alias);
+ 0, virtual_offset, alias);
if (DECL_ONE_ONLY (function))
thunk_node->add_to_same_comdat_group (funcn);