Message ID | 37591d69-b7c1-7a12-23b1-abb29d2183a2@suse.cz |
---|---|
State | Committed |
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 6CA803858006 for <patchwork@sourceware.org>; Wed, 15 Sep 2021 15:22:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 50A74385780F for <gcc-patches@gcc.gnu.org>; Wed, 15 Sep 2021 15:21:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50A74385780F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E835C22122; Wed, 15 Sep 2021 15:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1631719299; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RJPfcz6+0Z8iuCUMMtb+vgP9NVHxD2DRtJyVM+CiY8c=; b=1tBM/ohAjFvHxJSL/ElUeaFanutPibuA5MU5WOgP3QJ55OsKSWxFSdl3lgtoLcgZPQp31r Xq5zZb2L9URdn0sa0oPXu340+iNgbE6wZRZzEipmpmziK/3vPFDSKvZf1MUM0KhLk7a0mu XJ70EtVC6JLPvsz3nL0bH8xTQiXah4Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1631719299; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RJPfcz6+0Z8iuCUMMtb+vgP9NVHxD2DRtJyVM+CiY8c=; b=L7WTlN2lPivP5n1/A3z9OBNuch8NWdm7Iqy6uR/zHAE0QHQE7RjHQLziIWtc2LcvL52OJK OvdUd1NojWO602Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D42DE13C5D; Wed, 15 Sep 2021 15:21:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PctEMoMPQmF0HgAAMHmgww (envelope-from <mliska@suse.cz>); Wed, 15 Sep 2021 15:21:39 +0000 Message-ID: <37591d69-b7c1-7a12-23b1-abb29d2183a2@suse.cz> Date: Wed, 15 Sep 2021 17:21:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz> Subject: [PATCH][OBVIOUS] rs6000: fix symtab_node::get == NULL issue To: gcc-patches@gcc.gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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> Cc: David Edelsohn <dje.gcc@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 |
[OBVIOUS] rs6000: fix symtab_node::get == NULL issue
|
|
Commit Message
Martin Liška
Sept. 15, 2021, 3:21 p.m. UTC
Hello. The patch is approved by David and fixes the issue described in the PR. Martin PR target/102349 gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_xcoff_encode_section_info): Check that we have a symbol summary for a symbol. --- gcc/config/rs6000/rs6000.c | 1 + 1 file changed, 1 insertion(+)
Comments
This needs an additional adjustment. The encoding decoration needs to be applied if the decl isn't an alias. That means both a null summary *OR* the decl is not explicitly an alias. I'm proposing the following: diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d0830a95027..ad81dfb316d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21728,8 +21728,8 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, in t first) if (decl && DECL_P (decl) && VAR_OR_FUNCTION_DECL_P (decl) - && symtab_node::get (decl) != NULL - && symtab_node::get (decl)->alias == 0 + && (symtab_node::get (decl) == NULL + || symtab_node::get (decl)->alias == 0) && symname[strlen (symname) - 1] != ']') { const char *smclass = NULL; On Wed, Sep 15, 2021 at 11:21 AM Martin Liška <mliska@suse.cz> wrote: > > Hello. > > The patch is approved by David and fixes the issue described in the PR. > > Martin > > PR target/102349 > > gcc/ChangeLog: > > * config/rs6000/rs6000.c (rs6000_xcoff_encode_section_info): > Check that we have a symbol summary for a symbol. > --- > gcc/config/rs6000/rs6000.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index b0ec8108007..d0830a95027 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -21728,6 +21728,7 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, int first) > if (decl > && DECL_P (decl) > && VAR_OR_FUNCTION_DECL_P (decl) > + && symtab_node::get (decl) != NULL > && symtab_node::get (decl)->alias == 0 > && symname[strlen (symname) - 1] != ']') > { > -- > 2.33.0 >
On 9/15/21 20:40, David Edelsohn wrote: > This needs an additional adjustment. The encoding decoration needs to > be applied if the decl isn't an alias. That means both a null summary > *OR* the decl is not explicitly an alias. Oh, sorry, I made a stupid thinko. Please install the patch. Martin > > I'm proposing the following: > > diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c > index d0830a95027..ad81dfb316d 100644 > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -21728,8 +21728,8 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, in > t first) > if (decl > && DECL_P (decl) > && VAR_OR_FUNCTION_DECL_P (decl) > - && symtab_node::get (decl) != NULL > - && symtab_node::get (decl)->alias == 0 > + && (symtab_node::get (decl) == NULL > + || symtab_node::get (decl)->alias == 0) > && symname[strlen (symname) - 1] != ']') > { > const char *smclass = NULL; > > > On Wed, Sep 15, 2021 at 11:21 AM Martin Liška <mliska@suse.cz> wrote: >> >> Hello. >> >> The patch is approved by David and fixes the issue described in the PR. >> >> Martin >> >> PR target/102349 >> >> gcc/ChangeLog: >> >> * config/rs6000/rs6000.c (rs6000_xcoff_encode_section_info): >> Check that we have a symbol summary for a symbol. >> --- >> gcc/config/rs6000/rs6000.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c >> index b0ec8108007..d0830a95027 100644 >> --- a/gcc/config/rs6000/rs6000.c >> +++ b/gcc/config/rs6000/rs6000.c >> @@ -21728,6 +21728,7 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, int first) >> if (decl >> && DECL_P (decl) >> && VAR_OR_FUNCTION_DECL_P (decl) >> + && symtab_node::get (decl) != NULL >> && symtab_node::get (decl)->alias == 0 >> && symname[strlen (symname) - 1] != ']') >> { >> -- >> 2.33.0 >>
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b0ec8108007..d0830a95027 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21728,6 +21728,7 @@ rs6000_xcoff_encode_section_info (tree decl, rtx rtl, int first) if (decl && DECL_P (decl) && VAR_OR_FUNCTION_DECL_P (decl) + && symtab_node::get (decl) != NULL && symtab_node::get (decl)->alias == 0 && symname[strlen (symname) - 1] != ']') {