]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: fix xcoff section encoding
authorDavid Edelsohn <dje.gcc@gmail.com>
Wed, 15 Sep 2021 21:10:35 +0000 (17:10 -0400)
committerDavid Edelsohn <dje.gcc@gmail.com>
Wed, 15 Sep 2021 21:18:00 +0000 (17:18 -0400)
The encoding needs to be applied if the decl is not an alias: both a NULL
summary *OR* the decl alias flag is false.  This patch updates the
earlier fix to continue with the encoding selection if the summary is
NULL.

gcc/ChangeLog:
* config/rs6000/rs6000.c (rs6000_xcoff_encode_section_info):
Proceed if no symbol summary or the symbol alias flag is false.

gcc/config/rs6000/rs6000.c

index d0830a95027e0b940780b66b00fa9023987e96b9..ad81dfb316dff00cde810d6b1edd31fa49d5c1e8 100644 (file)
@@ -21728,8 +21728,8 @@ 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
+      && (symtab_node::get (decl) == NULL
+         || symtab_node::get (decl)->alias == 0)
       && symname[strlen (symname) - 1] != ']')
     {
       const char *smclass = NULL;