]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (rs6000_elf_select_section): Treat DEFAULT_ABI == ABI_AIX like PIC.
authorDavid Edelsohn <edelsohn@gnu.org>
Fri, 23 Aug 2002 18:02:22 +0000 (18:02 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Fri, 23 Aug 2002 18:02:22 +0000 (14:02 -0400)
        * config/rs6000/rs6000.c (rs6000_elf_select_section): Treat
        DEFAULT_ABI == ABI_AIX like PIC.  Test PIC & reloc for readonly
        default.
        (rs6000_elf_unique_section): Likewise.

From-SVN: r56544

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 0e6c87b980d0d77b3a6296a57d1cbbdfc1af273e..05a7437360a99bed49417017c211804d06829ed7 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-23  David Edelsohn  <edelsohn@gnu.org>
+
+       * config/rs6000/rs6000.c (rs6000_elf_select_section): Treat
+       DEFAULT_ABI == ABI_AIX like PIC.  Test PIC & reloc for readonly
+       default.
+       (rs6000_elf_unique_section): Likewise.
+
 2002-08-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * ns32k.c (ns32k_globalize_label): Delete.
index 3ea15aae36797d71b5b0adb69f4560d144507c3e..f9e86bee4c246485b80947880fc9ebaeec26f785 100644 (file)
@@ -12428,8 +12428,8 @@ rs6000_elf_select_section (decl, reloc, align)
      unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
 {
   int size = int_size_in_bytes (TREE_TYPE (decl));
-  int needs_sdata;
-  int readonly;
+  bool needs_sdata;
+  bool readonly;
   static void (* const sec_funcs[4]) PARAMS ((void)) = {
     &readonly_data_section,
     &sdata2_section,
@@ -12443,22 +12443,23 @@ rs6000_elf_select_section (decl, reloc, align)
                 && (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl)));
 
   if (TREE_CODE (decl) == STRING_CST)
-    readonly = ! flag_writable_strings;
+    readonly = !flag_writable_strings;
   else if (TREE_CODE (decl) == VAR_DECL)
-    readonly = (! (flag_pic && reloc)
+    readonly = (!((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc)
                && TREE_READONLY (decl)
-               && ! TREE_SIDE_EFFECTS (decl)
+               && !TREE_SIDE_EFFECTS (decl)
                && DECL_INITIAL (decl)
                && DECL_INITIAL (decl) != error_mark_node
                && TREE_CONSTANT (DECL_INITIAL (decl)));
   else if (TREE_CODE (decl) == CONSTRUCTOR)
-    readonly = (! (flag_pic && reloc)
-               && ! TREE_SIDE_EFFECTS (decl)
+    readonly = (!((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc)
+               && !TREE_SIDE_EFFECTS (decl)
                && TREE_CONSTANT (decl));
   else
-    readonly = 1;
+    readonly = !((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc);
+
   if (needs_sdata && rs6000_sdata != SDATA_EABI)
-    readonly = 0;
+    readonly = false;
   
   (*sec_funcs[(readonly ? 0 : 2) + (needs_sdata ? 1 : 0)])();
 }
@@ -12497,18 +12498,19 @@ rs6000_elf_unique_section (decl, reloc)
     sec = 6;
   else
     {
-      int readonly;
-      int needs_sdata;
+      bool readonly;
+      bool needs_sdata;
       int size;
 
-      readonly = 1;
       if (TREE_CODE (decl) == STRING_CST)
-       readonly = ! flag_writable_strings;
+       readonly = !flag_writable_strings;
       else if (TREE_CODE (decl) == VAR_DECL)
-       readonly = (! (flag_pic && reloc)
+       readonly = (!((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc)
                    && TREE_READONLY (decl)
-                   && ! TREE_SIDE_EFFECTS (decl)
+                   && !TREE_SIDE_EFFECTS (decl)
                    && TREE_CONSTANT (DECL_INITIAL (decl)));
+      else
+       readonly = !((flag_pic || DEFAULT_ABI == ABI_AIX) && reloc);
 
       size = int_size_in_bytes (TREE_TYPE (decl));
       needs_sdata = (size > 0 
@@ -12516,10 +12518,10 @@ rs6000_elf_unique_section (decl, reloc)
                     && rs6000_sdata != SDATA_NONE
                     && (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl)));
 
-      if (DECL_INITIAL (decl) == 0
+      if (DECL_INITIAL (decl) == NULL
          || DECL_INITIAL (decl) == error_mark_node)
        sec = 4;
-      else if (! readonly)
+      else if (!readonly)
        sec = 2;
       else
        sec = 0;