[gcc(refs/users/ppalka/heads/libstdcxx-floating-to_chars)] aix: only create named section for VAR_DECL or FUNCTION_DECL

Patrick Palka ppalka@gcc.gnu.org
Tue Jul 14 19:40:13 GMT 2020


https://gcc.gnu.org/g:c5ec2f858b78aaf22951395db97b25e2d0163dfc

commit c5ec2f858b78aaf22951395db97b25e2d0163dfc
Author: David Edelsohn <dje.gcc@gmail.com>
Date:   Fri Jul 10 17:06:21 2020 -0400

    aix: only create named section for VAR_DECL or FUNCTION_DECL
    
    get_constant_section() can be passed constant-like non-DECLs, such as
    CONSTRUCTOR or STRING_CST, which make DECL_SECTION_NAME unhappy
    (asserted in symtab_node::get).  This patch ensures that xcoff select
    section only invokes resolve_unique_section() for DECLs.
    
    gcc/ChangeLog
    
    2020-07-10  David Edelsohn  <dje.gcc@gmail.com>
    
            * config/rs6000/rs6000.c (rs6000_xcoff_select_section): Only
            create named section for VAR_DECL or FUNCTION_DECL.

Diff:
---
 gcc/config/rs6000/rs6000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 15af9b230e6..b42f0c5b33d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -20465,7 +20465,7 @@ rs6000_xcoff_select_section (tree decl, int reloc,
 {
   /* Place variables with alignment stricter than BIGGEST_ALIGNMENT into
      named section.  */
-  if (align > BIGGEST_ALIGNMENT)
+  if (align > BIGGEST_ALIGNMENT && VAR_OR_FUNCTION_DECL_P (decl))
     {
       resolve_unique_section (decl, reloc, true);
       if (IN_NAMED_SECTION (decl))


More information about the Gcc-cvs mailing list