Message ID | 20211024223023.1410274-1-rep.dot.nop@gmail.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9E3D3858410 for <patchwork@sourceware.org>; Sun, 24 Oct 2021 22:31:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9E3D3858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635114686; bh=L9t8F8QPf78k+mXrkT42MttbunVKB4kfWGQVYbdcH7s=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=kbovwzqkpqSqu2UXIRYVUmRSSO8gJjycRrsrsl/1MXog/nC7BfSTcbDYA82+odchd FJquNlI6C8dyjlBGj9O72dVeEAfliMt4rS3GuILcA2gmiyD+c2lsSwKofFvwah7I9s uB0gy++wt/B7NvvZyDqvVz1H9y/qZZUkJV3oHTPU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 225623858C27; Sun, 24 Oct 2021 22:30:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 225623858C27 Received: by mail-wr1-x431.google.com with SMTP id e4so9244953wrc.7; Sun, 24 Oct 2021 15:30:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L9t8F8QPf78k+mXrkT42MttbunVKB4kfWGQVYbdcH7s=; b=0W5WmRlfvn1l5J9hf/vw5mdKrQG+FCPNlQwqudtBx1zhyavMxQEcKmb9OMZL8eou2o bcnbxv9CC+vKOKjHocoxYb0cWxV8MY2dUMT2xAWcXM/uQKRKvJo28q5G796mL3Y4dS2T clHLSO/4UOolk8/FyGySAh/DWyn/uSb3448pohYXJze7BuVPbWBSE6S0KzCYA+lQyyuD rON5rt8JcRoaG62iR0Zz1VK8F9VWeDNsrrVbWSABgFkVwnkmfyrAlzeNlb6RfMDc2DiF vMTxn8bbS2NUmQXESnCxtxxKAFzKkO5u3LefrlQZNIUEA5hRkraZfu77QUumBdOPPkf4 IxpA== X-Gm-Message-State: AOAM532XL/7LyXYgkM5xIaq+CizYKE4oz5czzk8LEvVp3NlgFgv0/tS7 TnU7E2VDzP7zYpU0XBnIrQT9hfdiFXI= X-Google-Smtp-Source: ABdhPJzz7wPNuSkLqNIig1Ew4MXTo7iQmtA8tEDNZ9zPFeaV1Vqi9z3Qyg2ZiXhiobffdbp0hWDMLw== X-Received: by 2002:adf:a2d4:: with SMTP id t20mr18151526wra.229.1635114638893; Sun, 24 Oct 2021 15:30:38 -0700 (PDT) Received: from nbbrfq.weghof (dynamic-2bq7di4u2lfl4qjka9-pd01.res.v6.highway.a1.net. [2001:871:227:33a8:f6a3:c58c:7641:e771]) by smtp.gmail.com with ESMTPSA id p7sm14459361wrm.61.2021.10.24.15.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Oct 2021 15:30:38 -0700 (PDT) Received: from b by nbbrfq.weghof with local (Exim 4.95) (envelope-from <b@localhost>) id 1mem0j-005usr-Nd; Mon, 25 Oct 2021 00:30:37 +0200 To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: [PATCH,Fortran 0/7] delete some unused decls, make static Date: Mon, 25 Oct 2021 00:30:16 +0200 Message-Id: <20211024223023.1410274-1-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Bernhard Reutner-Fischer via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
delete some unused decls, make static
|
|
Message
Bernhard Reutner-Fischer
Oct. 24, 2021, 10:30 p.m. UTC
Hi! Quickly skimming through the frontend headers. There are a couple of declarations for functions that do not have definitions. And there are a couple of functions that can be static. Notes i took while at it / TODOs: - get rid of VTAB_GET_FIELD_GEN and unused extern decls - The last block of gfc_trans_vla_one_sizepos() could simply use gfc_evaluate_now_function_scope(). Passing down unshared val of course. - trans-expr.c has one use of gfc_evaluate_now_loc() but should simply use gfc_evaluate_now() there; Calling ...now_loc(input_location) is superfluous - s/mane/name/;# in git grep -w mane gcc/fortran/ - delete gfc_match_small_int, use gfc_match_small_literal_int instead - move gfc_match_null definition up before first user, make it static and delete decl from match.h - gfc_cpp_add_include_path_after move up, make static, rm external decl - gfc_walk_array_ref move up, make static, rm external decl - delete unused gfc_copy_only_alloc_comp ? - delete unused gfc_conv_descriptor_attribute ? - gfc_build_nan str arg is "" always. Delete parameter and handling? - delete unused gfc_simplify_get_team or wire it up in intrinsics, get_team handling (instead of the NULL..) Anyone who does coarrays might want to fill in the missing get_team() simplify and add an appropriate test. That's the only thing that i will not do as i once was more into MPI and verbs so won't ever do coarrays ;) Bootstraps fine, regression tests running over night. Ok for trunk if it passes? thanks, Bernhard Reutner-Fischer (7): Fortran: make some trans* functions static Fortran: make some match* functions static Fortran: make some constructor* functions static Fortran: make some trans-array functions static Fortran: Delete unused decl in trans-stmt.h Fortran: Delete unused decl in trans-types.h Fortran: Delete unused decl in intrinsic.h gcc/fortran/constructor.c | 20 ++------------------ gcc/fortran/constructor.h | 10 ---------- gcc/fortran/decl.c | 15 ++++++++------- gcc/fortran/expr.c | 2 +- gcc/fortran/gfortran.h | 1 - gcc/fortran/intrinsic.h | 4 ---- gcc/fortran/match.c | 28 +--------------------------- gcc/fortran/match.h | 10 ---------- gcc/fortran/scanner.c | 4 ++-- gcc/fortran/trans-array.c | 2 +- gcc/fortran/trans-array.h | 6 ------ gcc/fortran/trans-expr.c | 10 +++++----- gcc/fortran/trans-stmt.h | 1 - gcc/fortran/trans-types.c | 25 +++---------------------- gcc/fortran/trans-types.h | 4 ---- gcc/fortran/trans.c | 1 - gcc/fortran/trans.h | 11 ----------- 17 files changed, 23 insertions(+), 131 deletions(-)
Comments
On Mon, 25 Oct 2021 00:30:16 +0200 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> wrote: > Hi! > > Quickly skimming through the frontend headers. I'm also attaching the other view for the fortran FE after the header cleanup: python3 $topsrc/contrib/unused_functions.py gcc/fortran/ \ grep -v "gt_" for a guesstimate list of Symbol 'foo' declared extern but never referenced externally Down to about 50 for f951 as we want to keep the debug ones of course. For other language frontends see the head of the script; Back then there was no D nor modula2, and a go sample is missing, too. Should be rather straight forward if anyone is curious. You can just abbreviate the list of objects that are used to link your frontend. Archives are supposedly handled fine, at least last time i tried. HTH, gcc/fortran/match.o: Symbol 'type_param_spec_list' declared extern but never referenced externally gcc/fortran/openmp.o: Symbol 'gfc_free_expr_list(gfc_expr_list*)' declared extern but never referenced externally gcc/fortran/openmp.o: Symbol 'gfc_free_omp_declare_simd(gfc_omp_declare_simd*)' declared extern but never referenced externally gcc/fortran/openmp.o: Symbol 'gfc_match_omp_context_selector(gfc_omp_set_selector*)' declared extern but never referenced externally gcc/fortran/openmp.o: Symbol 'gfc_match_omp_context_selector_specification(gfc_omp_declare_variant*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_class_vtab_hash_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_class_vtab_extends_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_vptr_extends_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_class_vtab_def_init_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_vptr_def_init_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_class_vtab_copy_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_vptr_copy_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_vptr_final_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-expr.o: Symbol 'gfc_class_vtab_deallocate_get(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-decl.o: Symbol 'module_decl_hasher::hash(tree_node*)' declared extern but never referenced externally gcc/fortran/trans-decl.o: Symbol 'gfor_fndecl_set_args' declared extern but never referenced externally gcc/fortran/trans-decl.o: Symbol 'gfor_fndecl_set_convert' declared extern but never referenced externally gcc/fortran/trans-decl.o: Symbol 'gfor_fndecl_set_record_marker' declared extern but never referenced externally gcc/fortran/trans-decl.o: Symbol 'gfor_fndecl_set_max_subrecord_length' declared extern but never referenced externally gcc/fortran/simplify.o: Symbol 'gfc_simplify_get_team(gfc_expr*)' declared extern but never referenced externally gcc/fortran/simplify.o: Symbol 'simplify_ieee_selected_real_kind(gfc_expr*)' declared extern but never referenced externally gcc/fortran/simplify.o: Symbol 'simplify_ieee_support(gfc_expr*)' declared extern but never referenced externally gcc/fortran/decl.o: Symbol 'gfc_match_null(gfc_expr**)' declared extern but never referenced externally gcc/fortran/decl.o: Symbol 'gfc_insert_kind_parameter_exprs(gfc_expr*)' declared extern but never referenced externally gcc/fortran/decl.o: Symbol 'check_bind_name_identifier(char**)' declared extern but never referenced externally gcc/fortran/decl.o: Symbol 'gfc_mod_pointee_as(gfc_array_spec*)' declared extern but never referenced externally gcc/fortran/module.o: Symbol 'mio_symbol_ref(gfc_symbol**)' declared extern but never referenced externally gcc/fortran/module.o: Symbol 'mio_interface_rest(gfc_interface**)' declared extern but never referenced externally gcc/fortran/trans-intrinsic.o: Symbol 'specific_intrinsic_symbol(gfc_expr*)' declared extern but never referenced externally gcc/fortran/resolve.o: Symbol 'gfc_elemental(gfc_symbol*)' declared extern but never referenced externally gcc/fortran/trans-openmp.o: Symbol 'gfc_trans_oacc_declare(gfc_code*)' declared extern but never referenced externally gcc/fortran/primary.o: Symbol 'matching_actual_arglist' declared extern but never referenced externally gcc/fortran/symbol.o: Symbol 'gfc_drop_last_undo_checkpoint()' declared extern but never referenced externally gcc/fortran/symbol.o: Symbol 'gfc_restore_last_undo_checkpoint()' declared extern but never referenced externally gcc/fortran/symbol.o: Symbol 'gfc_get_ultimate_derived_super_type(gfc_symbol*)' declared extern but never referenced externally gcc/fortran/gfortranspec.o: Symbol 'lang_specific_pre_link()' declared extern but never referenced externally gcc/fortran/gfortranspec.o: Symbol 'lang_specific_extra_outfiles' declared extern but never referenced externally gcc/fortran/class.o: Symbol 'gfc_intrinsic_hash_value(gfc_typespec*)' declared extern but never referenced externally gcc/fortran/trans-array.o: Symbol 'gfc_conv_descriptor_attribute(tree_node*)' declared extern but never referenced externally gcc/fortran/cpp.o: Symbol 'gfc_cpp_option' declared extern but never referenced externally gcc/fortran/error.o: Symbol 'notify_std_msg(int)' declared extern but never referenced externally gcc/fortran/frontend-passes.o: Symbol 'n_vars' declared extern but never referenced externally gcc/fortran/frontend-passes.o: Symbol 'stack_top' declared extern but never referenced externally gcc/fortran/frontend-passes.o: Symbol 'evec' declared extern but never referenced externally gcc/fortran/interface.o: Symbol 'maybe_dummy_array_arg(gfc_expr*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(symbol_attribute*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_formal_arglist*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(symbol_attribute)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_expr*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_typespec*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_typespec)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_ref*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'gfc_debug_expr(gfc_expr*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'gfc_debug_code(gfc_code*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_symbol*)' declared extern but never referenced externally gcc/fortran/dump-parse-tree.o: Symbol 'debug(gfc_array_ref*)' declared extern but never referenced externally
On Mon, 25 Oct 2021 00:30:16 +0200 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> wrote: > Hi! > > Quickly skimming through the frontend headers. > There are a couple of declarations for functions that do not have > definitions. And there are a couple of functions that can be static. > Bootstraps fine, regression tests running over night. > Ok for trunk if it passes? Tested with no regressions on x86_64-unknown-linux {-m32,-m64}. Ok for trunk?