From patchwork Thu Oct 20 13:17:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 684582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t08WM5m8Wz9sD6 for ; Fri, 21 Oct 2016 00:18:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=EgFLHFLR; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=RxhqJZYeTZysr+G2nR6g1FH+TnFNpSGf6+hyMBU8TsL oDVYK4mKmfJlQrJObPQ8NzHzQ3Zp0bO2dyGGVHGMHAH5Qv2ZYKMjhwFQUBDrD+9w fyAiS7a0GTOJ0QX/9vJ3MHrCoyMblI4OOQ2wLPF1k92m1YMC2z8x9iqklGGW7UmM = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=ofqRsF24jxF9TjWFveM0O8FR0Co=; b=EgFLHFLRNDq5PBl1C S6/1k/23nbVTysGoC/Xu/9/rHQyNIwLCC9UT+aoQn/CFKFpFtYzJ7agZf3AjHnl7 64E68/wS8uPek6c8DQUHRKrn3d+x6MKyI3ZcX/oOPHSiGiGN/oX3ZTmu5IZ2Q444 cHGLHezgXPWql3DqrLHs3TtxiY= Received: (qmail 82428 invoked by alias); 20 Oct 2016 13:17:58 -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 82409 invoked by uid 89); 20 Oct 2016 13:17:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=apparent X-HELO: mail-qk0-f177.google.com Received: from mail-qk0-f177.google.com (HELO mail-qk0-f177.google.com) (209.85.220.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Oct 2016 13:17:46 +0000 Received: by mail-qk0-f177.google.com with SMTP id z190so93227443qkc.2 for ; Thu, 20 Oct 2016 06:17:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=+uLh+mX4zA00bh3OE9uPiqUcixVKhq/4uOwpevHJIwc=; b=EpOrVc5v7dEMFDV0FUcnJD95zQO+2VLv1BSU25ygiEVmVQiOsc+p8wdJwYEnwOpxv3 LyoqH4W6v6aVNsVj0FvIP8IgM9FDrGEHmyOgax5mlgr827hN4I9PXmFdnl1Z37aAsHx1 6hc41YQfqLaW+qWHUFf0DxTu1uiZS50olf2goTNhSHCjpwONeAi7D0HulnNs3MaNx3Db kFAG79plnl7Pdz1RVWrlhpTnviy1BYnhCL6rxKLrsq2yFydcumG4OJf8xoaI+VFUTz3A 3XhjUriXLOkU3bsFHGsJuzmXlDWlEo4FSo7kQWPKFdc0xh2g25MwpMTfz/cdQb8jmPbk 9T6A== X-Gm-Message-State: ABUngvdWlBAZXnve9yDhq+ROjOm8DFMi4/rPBsVicurG7RBIBu1Y5EQNTB0hdVacMS/lF3MrQCVCGtuGVyvcww== X-Received: by 10.55.203.9 with SMTP id d9mr768112qkj.215.1476969463767; Thu, 20 Oct 2016 06:17:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.131.225 with HTTP; Thu, 20 Oct 2016 06:17:43 -0700 (PDT) From: David Edelsohn Date: Thu, 20 Oct 2016 09:17:43 -0400 Message-ID: Subject: [PATCH] rs6000.c visitibility fix and formatting To: Segher Boessenkool Cc: GCC Patches I noticed that rs6000.c rs6000_assemble_visibility has two of the visibility keywords swapped. This only is used for ELF with dot symbols, which are deprecated, so any problems were not apparent, but it should be fixed. The function defines the keywords as: static const char * const visibility_types[] = { NULL, "internal", "hidden", "protected" }; It was added in that order by rth in 2002 https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/rs6000/rs6000.c?r1=59559&r2=59558&pathrev=59559 While coretypes.h defines enum symbol_visibility { VISIBILITY_DEFAULT, VISIBILITY_PROTECTED, VISIBILITY_HIDDEN, VISIBILITY_INTERNAL }; and varasm.c default_assemble_visibility similarly defines static const char * const visibility_types[] = { NULL, "protected", "hidden", "internal" }; Also another set of lines are too long by GCC formatting standards. Bootstrapped on powerpc-ibm-aix7.1.0.0. Thanks, David * config/rs6000/rs6000.c (rs6000_assemble_visibility): Swap "internal" and "protected" in visibility types. (rs6000_xcoff_declare_function_name): Fix formatting. (rs6000_xcoff_declare_object_name): Fix formatting. fputs (", TOC[tc0], 0\n", file); @@ -35258,7 +35259,8 @@ rs6000_xcoff_declare_function_name (FILE *file, co RS6000_OUTPUT_BASENAME (file, buffer); fputs (":\n", file); data.function_descriptor = true; - symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, &data, true); + symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, + &data, true); if (!DECL_IGNORED_P (decl)) { if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG) @@ -35282,7 +35284,8 @@ rs6000_xcoff_declare_object_name (FILE *file, cons struct declare_alias_data data = {file, false}; RS6000_OUTPUT_BASENAME (file, name); fputs (":\n", file); - symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, &data, true); + symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, + &data, true); } /* Overide the default 'SYMBOL-.' syntax with AIX compatible 'SYMBOL-$'. */ Index: rs6000.c =================================================================== --- rs6000.c (revision 241359) +++ rs6000.c (working copy) @@ -22676,7 +22676,7 @@ rs6000_assemble_visibility (tree decl, int vis) && TREE_CODE (decl) == FUNCTION_DECL) { static const char * const visibility_types[] = { - NULL, "internal", "hidden", "protected" + NULL, "protected", "hidden", "internal" }; const char *name, *type; @@ -35248,7 +35248,8 @@ rs6000_xcoff_declare_function_name (FILE *file, co fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", file); RS6000_OUTPUT_BASENAME (file, buffer); fputs (":\n", file); - symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, &data, true); + symtab_node::get (decl)->call_for_symbol_and_aliases (rs6000_declare_alias, + &data, true); fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", file); RS6000_OUTPUT_BASENAME (file, buffer);