From patchwork Fri Jan 6 14:04:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 90170 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9461063qgi; Fri, 6 Jan 2017 06:05:17 -0800 (PST) X-Received: by 10.84.140.3 with SMTP id 3mr166921580pls.61.1483711517595; Fri, 06 Jan 2017 06:05:17 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e26si9439951pfk.231.2017.01.06.06.05.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 06:05:17 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445539-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445539-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445539-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=pWqsAV/WMuLczget3PeKmpyAMS98ONejkzm4ajW8qv+mEK7TE9 NcP0d95qO+igwPTwx0V5txrTRg++VohUkaIsMQs08xJQqhx2aBKRbNbKfCJv7gDt bGv1Xym7K7niR4wxgU8ricXOtm+zwxa5tzFIx9jSf+CJ+tSkAzfQAxL3U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=npM7B2hKWqDFRmSYO9YmmzmCXio=; b=REOCCY6YsCWYKeJW9tei VJ35CUF1OXdu5FTpVfSUHxNL4CPQVeonbc0wFT29LSIe8FeqlBXk62OdIkx6w0XX p+qAYZpxLJI0Z/zh/5PgO5xd1q6cmTfQGzayAvQCTEzNXEF1scnWPfNNYSP+IVGr AniPC8fBBVng9q8C6kqLb3o= Received: (qmail 123530 invoked by alias); 6 Jan 2017 14:05:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 123288 invoked by uid 89); 6 Jan 2017 14:05:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=nathan@acm.org, nathanacmorg, H*RU:200, Hx-spam-relays-external:200 X-HELO: mail-yw0-f179.google.com Received: from mail-yw0-f179.google.com (HELO mail-yw0-f179.google.com) (209.85.161.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jan 2017 14:04:52 +0000 Received: by mail-yw0-f179.google.com with SMTP id r204so370223128ywb.0 for ; Fri, 06 Jan 2017 06:04:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version; bh=2MboEWZBBkUgMoVy1BiNQjRdRsopOgnmlMC64a/1yAk=; b=JjRbWS/1KQwI18o50oCMdLkwZEyaQahscGJs1PMlKPuKFhbetlNK+OAAxCwFsWLQ4V mytbTwkLFIZMR6YQnHqliFxKYC7HjLjb8FVBvDZdmazuP9pfMVBGEGTBxMudtmsDJ6Ei hNYALhsI4NTkGq12282IV4B7mKD6wbR00/1mgW77Q+P7sQSrgBwC1P9rehViQiePDIY9 2quCGPOjPZij+MVvYT6KYISRg4VjRO8ShFT/5v3D7kYR3aSgq8LF0St0bj/uGIHTF9zj iEaBSzj5/qNJZwEc6MKsREkoCVrI71+QcjlXt+VJOwVIprOyAGHhstv+81QV7FXynQ62 WrGQ== X-Gm-Message-State: AIkVDXKC8NltgzsfO0rRFo1YXHkf73chyQY1J8EtO7NJ80aXsXqPOxSJlShSac4Wz4f1fw== X-Received: by 10.129.90.67 with SMTP id o64mr73192584ywb.188.1483711490993; Fri, 06 Jan 2017 06:04:50 -0800 (PST) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::10c]) by smtp.googlemail.com with ESMTPSA id p3sm33370225ywc.22.2017.01.06.06.04.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 06:04:50 -0800 (PST) To: GCC Patches , Jan Hubicka From: Nathan Sidwell Subject: [PATCH] ipa/lto formatting Message-ID: Date: Fri, 6 Jan 2017 09:04:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In debugging an lto problem, I fixed up some comments and formatting I stumbled across. Committed as obvious. nathan -- Nathan Sidwell 2017-01-06 Nathan Sidwell gcc/ * ipa-visibility.c (function_and_variable_visibility): Reformat comments and long lines. Remove extrneous if. * symtab.c (symtab_node::make_decl_local): Fix code format. (symtab_node::set_section_for_node): Fix comment typo. gcc/lto/ * lto-partition.c (lto_balanced_map): Reformat/respell comment. (may_need_named_section_p): Likewise. (rename_statics): Likewise. (lto_promote_cross_file_statics): Likewise. Index: ipa-visibility.c =================================================================== --- ipa-visibility.c (revision 244151) +++ ipa-visibility.c (working copy) @@ -553,9 +553,9 @@ function_and_variable_visibility (bool w DECL_STATIC_DESTRUCTOR (node->decl) = 0; } - /* Frontends and alias code marks nodes as needed before parsing is finished. - We may end up marking as node external nodes where this flag is meaningless - strip it. */ + /* Frontends and alias code marks nodes as needed before parsing + is finished. We may end up marking as node external nodes + where this flag is meaningless strip it. */ if (DECL_EXTERNAL (node->decl) || !node->definition) { node->force_output = 0; @@ -609,35 +609,36 @@ function_and_variable_visibility (bool w { gcc_assert (whole_program || in_lto_p || !TREE_PUBLIC (node->decl)); - node->unique_name |= ((node->resolution == LDPR_PREVAILING_DEF_IRONLY - || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) - && TREE_PUBLIC (node->decl) - && !flag_incremental_link); + node->unique_name + |= ((node->resolution == LDPR_PREVAILING_DEF_IRONLY + || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) + && TREE_PUBLIC (node->decl) + && !flag_incremental_link); node->resolution = LDPR_PREVAILING_DEF_IRONLY; if (node->same_comdat_group && TREE_PUBLIC (node->decl)) { symtab_node *next = node; /* Set all members of comdat group local. */ - if (node->same_comdat_group) - for (next = node->same_comdat_group; - next != node; - next = next->same_comdat_group) + for (next = node->same_comdat_group; + next != node; + next = next->same_comdat_group) { next->set_comdat_group (NULL); if (!next->alias) next->set_section (NULL); if (!next->transparent_alias) next->make_decl_local (); - next->unique_name |= ((next->resolution == LDPR_PREVAILING_DEF_IRONLY - || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) - && TREE_PUBLIC (next->decl) - && !flag_incremental_link); + next->unique_name + |= ((next->resolution == LDPR_PREVAILING_DEF_IRONLY + || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) + && TREE_PUBLIC (next->decl) + && !flag_incremental_link); } - /* cgraph_externally_visible_p has already checked all other nodes - in the group and they will all be made local. We need to - dissolve the group at once so that the predicate does not - segfault though. */ + /* cgraph_externally_visible_p has already checked all + other nodes in the group and they will all be made + local. We need to dissolve the group at once so that + the predicate does not segfault though. */ node->dissolve_same_comdat_group_list (); } if (TREE_PUBLIC (node->decl)) Index: lto/lto-partition.c =================================================================== --- lto/lto-partition.c (revision 244151) +++ lto/lto-partition.c (working copy) @@ -668,8 +668,9 @@ lto_balanced_map (int n_lto_partitions, vnode = dyn_cast (ref->referring); gcc_assert (vnode->definition); - /* It is better to couple variables with their users, because it allows them - to be removed. Coupling with objects they refer to only helps to reduce + /* It is better to couple variables with their users, + because it allows them to be removed. Coupling + with objects they refer to only helps to reduce number of symbols promoted to hidden. */ if (!symbol_partitioned_p (vnode) && flag_toplevel_reorder && !vnode->no_reorder @@ -1008,10 +1009,11 @@ promote_symbol (symtab_node *node) "Promoting as hidden: %s\n", node->name ()); } -/* Return true if NODE needs named section even if it won't land in the partition - symbol table. - FIXME: we should really not use named sections for inline clones and master - clones. */ +/* Return true if NODE needs named section even if it won't land in + the partition symbol table. + + FIXME: we should really not use named sections for inline clones + and master clones. */ static bool may_need_named_section_p (lto_symtab_encoder_t encoder, symtab_node *node) @@ -1089,7 +1091,8 @@ rename_statics (lto_symtab_encoder_t enc || lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND)) { if (privatize_symbol_name (s)) - /* Re-start from beginning since we do not know how many symbols changed a name. */ + /* Re-start from beginning since we do not know how many + symbols changed a name. */ s = symtab_node::get_for_asmname (name); else s = s->next_sharing_asm_name; } @@ -1130,8 +1133,8 @@ lto_promote_cross_file_statics (void) { symtab_node *node = lsei_node (lsei); - /* If symbol is static, rename it if its assembler name clash with - anything else in this unit. */ + /* If symbol is static, rename it if its assembler name + clashes with anything else in this unit. */ rename_statics (encoder, node); /* No need to promote if symbol already is externally visible ... */ @@ -1139,7 +1142,7 @@ lto_promote_cross_file_statics (void) /* ... or if it is part of current partition ... */ || lto_symtab_encoder_in_partition_p (encoder, node) /* ... or if we do not partition it. This mean that it will - appear in every partition refernecing it. */ + appear in every partition referencing it. */ || node->get_partitioning_class () != SYMBOL_PARTITION) { validize_symbol_for_target (node); Index: symtab.c =================================================================== --- symtab.c (revision 244151) +++ symtab.c (working copy) @@ -1259,7 +1259,8 @@ symtab_node::make_decl_local (void) TREE_ADDRESSABLE (decl) = 1; TREE_STATIC (decl) = 1; } - else gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); + else + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); DECL_COMDAT (decl) = 0; DECL_WEAK (decl) = 0; @@ -1439,7 +1440,7 @@ symtab_node::fixup_same_cpp_alias_visibi } /* Set section, do not recurse into aliases. - When one wants to change section of symbol and its aliases, + When one wants to change section of a symbol and its aliases, use set_section. */ void