From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by sourceware.org (Postfix) with ESMTPS id C65A93858C39 for ; Wed, 15 Sep 2021 18:41:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C65A93858C39 Received: by mail-vs1-xe30.google.com with SMTP id u8so3747699vsp.1 for ; Wed, 15 Sep 2021 11:41:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4AWOqY6IFRff9umJG3DgrcgmX7dCKo3nj8KAgUNpvec=; b=I+Qi6asE67xxPEVJiMAefKjlkkIUUEVT5JulGUKTv4fvaXsj8g/rpbAlHcDa51xWUi wNmk3eWzgDilhS9awXwkBDsBn4a8l5g1L48HXDEAJKjOTH7Jd/gIRSEyw4F0WK/fUi8o klRMiAwhu2HhNN2wdimEF9VpedDeHMbWO1WeQa+n0tCtCsHUcmqwzJzyqNgSmCGNF0Fw SN5kqKKsmY+XDEVdnxrf1abQgUpyMi7Rp/yZ31EaFnlo+gFduIX8i6Uo3LMtJKt45iXG eQqQxwk2ZDU0F08DjXO6MXrJvOOnG9PPZi3VrqKcPHPLGZDxx4kttteXAL8Oad4w++L+ tvaw== X-Gm-Message-State: AOAM531qdjP9XfpgZ588wjxuPNCa0taHzxXqUH4wD9LkBgAl4nJIUXBE pp4cXLxU/I0q59tw6CDxcxG12c1hlnZaSZ7k/f4= X-Google-Smtp-Source: ABdhPJzACRYHE0ct6Gxnv8+Fa3wVnV1ALw5NUgdJ5cDgufGYRiajBvaAF8EQCGhMf3ezEdJlFKeuPeU8o91u3pkuYAk= X-Received: by 2002:a67:fd96:: with SMTP id k22mr1485481vsq.30.1631731270361; Wed, 15 Sep 2021 11:41:10 -0700 (PDT) MIME-Version: 1.0 References: <37591d69-b7c1-7a12-23b1-abb29d2183a2@suse.cz> In-Reply-To: <37591d69-b7c1-7a12-23b1-abb29d2183a2@suse.cz> From: David Edelsohn Date: Wed, 15 Sep 2021 14:40:37 -0400 Message-ID: Subject: Re: [PATCH][OBVIOUS] rs6000: fix symtab_node::get == NULL issue To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 18:41:12 -0000 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 rt= l, in t first) if (decl && DECL_P (decl) && VAR_OR_FUNCTION_DECL_P (decl) - && symtab_node::get (decl) !=3D NULL - && symtab_node::get (decl)->alias =3D=3D 0 + && (symtab_node::get (decl) =3D=3D NULL + || symtab_node::get (decl)->alias =3D=3D 0) && symname[strlen (symname) - 1] !=3D ']') { const char *smclass =3D NULL; On Wed, Sep 15, 2021 at 11:21 AM Martin Li=C5=A1ka 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) !=3D NULL > && symtab_node::get (decl)->alias =3D=3D 0 > && symname[strlen (symname) - 1] !=3D ']') > { > -- > 2.33.0 >