summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-23 18:02:22 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-23 18:02:22 +0000
commita2a1eb8a7002a1acf6a1654a581581acb36da4a8 (patch)
treee2bce1e8f0eae7541bc641155d270506cb549f80
parent554fe7d17e29e30ffe8cb9d9f2fd380e4d62db1e (diff)
downloadgcc-a2a1eb8a7002a1acf6a1654a581581acb36da4a8.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56544 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/rs6000/rs6000.c36
2 files changed, 26 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0e6c87b980d..05a7437360a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 3ea15aae367..f9e86bee4c2 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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;