From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id BE3D8385702B; Fri, 9 Jun 2023 08:08:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE3D8385702B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686298094; bh=g1WBAutRVmuGwc95/WYiwfxfai2GzJPTW7KFmGrSXLc=; h=From:To:Subject:Date:From; b=gl3T8fmVfxYvb+SRWTIoLiehGeCM+hPLlnzzpXiw8NqVGKtS5XhV+R3wFW1lIjqAJ HwT/Me6sKltgO6yMOu8sQiYvesjWqhhW1JogZQtzic7nFFLu1LualRTQqkLe70sg3k yoEKxP3LiLlWAZnJZdIv97BY5YveXK1VhesL8K8E= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] drop obsolete compat gunk from strub X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 3af07c3573bc68c4f826a88e4e18a1978f8258e5 X-Git-Newrev: 319b6cad5025523d5636e2921a1849a36d835a52 Message-Id: <20230609080814.BE3D8385702B@sourceware.org> Date: Fri, 9 Jun 2023 08:08:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:319b6cad5025523d5636e2921a1849a36d835a52 commit 319b6cad5025523d5636e2921a1849a36d835a52 Author: Alexandre Oliva Date: Thu Jun 8 07:40:04 2023 -0300 drop obsolete compat gunk from strub Diff: --- gcc/ipa-strub.cc | 69 ++++---------------------------------------------------- 1 file changed, 4 insertions(+), 65 deletions(-) diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc index 5fc4fca550d..921e4eb05ac 100644 --- a/gcc/ipa-strub.cc +++ b/gcc/ipa-strub.cc @@ -58,16 +58,8 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic.h" #include "intl.h" #include "ipa-strub.h" - -#if BUILDING_GCC_MAJOR >= 11 -# include "symtab-thunks.h" -# include "attr-fnspec.h" -# define HAVE_ATTR_FNSPEC 1 -# define FOR_GCC_11P 1 -#else -# define HAVE_ATTR_FNSPEC 0 -# define FOR_GCC_11P 0 -#endif +#include "symtab-thunks.h" +#include "attr-fnspec.h" /* Const and pure functions that gain a watermark parameter for strub purposes are still regarded as such, which may cause the inline expansions of the @@ -1675,7 +1667,7 @@ public: { \ tree type = build_function_type_list FNTYPELIST; \ tree attrs = NULL; \ - if (FNSPEC && HAVE_ATTR_FNSPEC) \ + if (FNSPEC) \ attrs = tree_cons (get_identifier ("fn spec"), \ build_tree_list \ (NULL_TREE, \ @@ -1737,11 +1729,7 @@ public: gimple_set_location (update, DECL_SOURCE_LOCATION (node->decl)); gimple_seq_add_stmt (&seq, update); if (node) -#if !IMPLICIT_CGRAPH_EDGES node->create_edge (cgraph_node::get_create (uwm), update, count, false); -#else - (void)count; -#endif return seq; } @@ -1932,10 +1920,6 @@ build_ref_type_for (tree parm, bool nonaliased = true) static void add_call_edges_for_seq (gimple_seq seq, profile_count count) { -#if IMPLICIT_CGRAPH_EDGES - return; -#endif - cgraph_node *node = cgraph_node::get_create (current_function_decl); for (gimple_stmt_iterator gsi = gsi_start (seq); @@ -2326,10 +2310,8 @@ pass_ipa_strub::adjust_at_calls_call (cgraph_edge *e, int named_args, if (gimple_has_location (ocall)) gimple_set_location (stptr, gimple_location (ocall)); gsi_insert_before (&gsi, stptr, GSI_SAME_STMT); -#if !IMPLICIT_CGRAPH_EDGES e->caller->create_edge (cgraph_node::get_create (enter), stptr, gsi_bb (gsi)->count, false); -#endif } @@ -2757,11 +2739,7 @@ pass_ipa_strub::execute (function *) relayout_decl (nparm); TREE_ADDRESSABLE (nparm) = 0; DECL_BY_REFERENCE (nparm) = 0; -#if FOR_GCC_11P DECL_NOT_GIMPLE_REG_P (nparm) = 0; -#else - DECL_GIMPLE_REG_P (nparm) = 1; -#endif /* ??? This avoids mismatches in debug info bind stmts in e.g. a-chahan . */ DECL_ABSTRACT_ORIGIN (nparm) = NULL; @@ -2781,7 +2759,6 @@ pass_ipa_strub::execute (function *) gcc_checking_assert (TYPE_ARG_TYPES (nftype) != TYPE_ARG_TYPES (TREE_TYPE (onode->decl))); -#if HAVE_ATTR_FNSPEC /* Check that fnspec still works for the modified function signature, and drop it otherwise. */ bool drop_fnspec = false; @@ -2793,20 +2770,15 @@ pass_ipa_strub::execute (function *) retcopy = (unsigned) -1; unsigned i = 0; -#endif for (tree nparm = DECL_ARGUMENTS (nnode->decl), nparmt = TYPE_ARG_TYPES (nftype); adjust_ftype > 0; -#if HAVE_ATTR_FNSPEC - i++, -#endif - nparm = DECL_CHAIN (nparm), nparmt = TREE_CHAIN (nparmt)) + i++, nparm = DECL_CHAIN (nparm), nparmt = TREE_CHAIN (nparmt)) if (indirect_nparms.contains (nparm)) { TREE_VALUE (nparmt) = TREE_TYPE (nparm); adjust_ftype--; -#if HAVE_ATTR_FNSPEC if (fnspec && !drop_fnspec) { if (i == retcopy) @@ -2834,15 +2806,12 @@ pass_ipa_strub::execute (function *) drop_fnspec = true; } } -#endif } -#if HAVE_ATTR_FNSPEC /* ??? Maybe we could adjust it instead. */ if (drop_fnspec) remove_named_attribute_unsharing ("fn spec", &TYPE_ATTRIBUTES (nftype)); -#endif TREE_TYPE (nnode->decl) = nftype; } @@ -2944,17 +2913,9 @@ pass_ipa_strub::execute (function *) /* Turn alias into thunk and expand it into GIMPLE representation. */ onode->definition = true; -#if FOR_GCC_11P thunk_info::get_create (onode); onode->thunk = true; -#else - memset (&onode->thunk, 0, sizeof (cgraph_thunk_info)); - onode->thunk.thunk_p = true; - onode->thunk.alias = target->decl; -#endif -#if !IMPLICIT_CGRAPH_EDGES onode->create_edge (target, NULL, onode->count); -#endif onode->callees->can_throw_external = !TREE_NOTHROW (target->decl); tree arguments = DECL_ARGUMENTS (decl); @@ -2990,11 +2951,9 @@ pass_ipa_strub::execute (function *) current_function_decl = thunk_fndecl; -#if FOR_GCC_11P /* Ensure thunks are emitted in their correct sections. */ resolve_unique_section (thunk_fndecl, 0, flag_function_sections); -#endif bitmap_obstack_initialize (NULL); @@ -3078,14 +3037,8 @@ pass_ipa_strub::execute (function *) tree addr = build1 (ADDR_EXPR, ref_type, arg); tmp = arg = addr; } -#if ! FOR_GCC_11P - else if (VECTOR_TYPE_P (TREE_TYPE (arg)) - || TREE_CODE (TREE_TYPE (arg)) == COMPLEX_TYPE) - DECL_GIMPLE_REG_P (arg) = 1; -#else else DECL_NOT_GIMPLE_REG_P (arg) = 0; -#endif /* Convert the argument back to the type used by the calling conventions, e.g. a non-prototyped float type is passed as @@ -3169,10 +3122,8 @@ pass_ipa_strub::execute (function *) profile_status_for_fn (cfun) = cfg_count.initialized_p () && cfg_count.ipa_p () ? PROFILE_READ : PROFILE_GUESSED; -#if FOR_GCC_11P /* FIXME: C++ FE should stop setting TREE_ASM_WRITTEN on thunks. */ // TREE_ASM_WRITTEN (thunk_fndecl) = false; -#endif delete_unreachable_blocks (); update_ssa (TODO_update_ssa); checking_verify_flow_info (); @@ -3180,11 +3131,7 @@ pass_ipa_strub::execute (function *) /* Since we want to emit the thunk, we explicitly mark its name as referenced. */ -#if FOR_GCC_11P onode->thunk = false; -#else - onode->thunk.thunk_p = false; -#endif onode->lowered = true; bitmap_obstack_release (NULL); } @@ -3192,9 +3139,7 @@ pass_ipa_strub::execute (function *) set_cfun (NULL); } -#if FOR_GCC_11P thunk_info::remove (onode); -#endif // some more of create_wrapper at the end of the next block. } @@ -3381,10 +3326,8 @@ pass_ipa_strub::execute (function *) gcall *stptr = gimple_build_call (enter, 1, unshare_expr (swmp)); gimple_set_location (stptr, gimple_location (wrcall)); gsi_insert_before (&gsi, stptr, GSI_SAME_STMT); -#if !IMPLICIT_CGRAPH_EDGES onode->create_edge (cgraph_node::get_create (enter), stptr, gsi_bb (gsi)->count, false); -#endif int nargs = gimple_call_num_args (wrcall); @@ -3399,10 +3342,8 @@ pass_ipa_strub::execute (function *) gimple_set_location (appargs, gimple_location (wrcall)); gsi_insert_before (&gsi, appargs, GSI_SAME_STMT); gimple_call_set_arg (wrcall, nargs - 2 - is_stdarg, aalst); -#if !IMPLICIT_CGRAPH_EDGES onode->create_edge (cgraph_node::get_create (bappargs), appargs, gsi_bb (gsi)->count, false); -#endif } if (is_stdarg) @@ -3420,10 +3361,8 @@ pass_ipa_strub::execute (function *) integer_zero_node); gimple_set_location (vastart, gimple_location (wrcall)); gsi_insert_before (&gsi, vastart, GSI_SAME_STMT); -#if !IMPLICIT_CGRAPH_EDGES onode->create_edge (cgraph_node::get_create (bvastart), vastart, gsi_bb (gsi)->count, false); -#endif tree bvaend = builtin_decl_explicit (BUILT_IN_VA_END); gcall *vaend = gimple_build_call (bvaend, 1, unshare_expr (vaptr));