diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-03-18 23:43:00 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-03-18 23:43:00 +0000 |
commit | 193de2ab3c0a8fc92003517939810bc52d556e87 (patch) | |
tree | f0a28f279a86dda097db4b1543ece6ced2c93aa7 /gcc/config | |
parent | 3da35046312275cf4046f78fa135a4a2c1615cac (diff) | |
download | gcc-193de2ab3c0a8fc92003517939810bc52d556e87.tar.gz |
(SELECT_SECTION): Variables go in readonly data
only if the initializer is constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/osfrose.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/svr3gas.h | 5 | ||||
-rw-r--r-- | gcc/config/m88k/m88k.h | 9 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 5 | ||||
-rw-r--r-- | gcc/config/nextstep.h | 16 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.h | 12 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 3 | ||||
-rw-r--r-- | gcc/config/svr3.h | 5 | ||||
-rw-r--r-- | gcc/config/svr4.h | 5 | ||||
-rw-r--r-- | gcc/config/vax/vms.h | 5 |
10 files changed, 52 insertions, 18 deletions
diff --git a/gcc/config/i386/osfrose.h b/gcc/config/i386/osfrose.h index 858c2772e68..14f4b95f661 100644 --- a/gcc/config/i386/osfrose.h +++ b/gcc/config/i386/osfrose.h @@ -707,7 +707,10 @@ while (0) else if (TREE_CODE (DECL) != VAR_DECL) \ readonly_data_section (); \ \ - else if (!TREE_READONLY (DECL)) \ + else if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ \ else \ diff --git a/gcc/config/i386/svr3gas.h b/gcc/config/i386/svr3gas.h index d6b0d95b0e1..cafbdd56a4f 100644 --- a/gcc/config/i386/svr3gas.h +++ b/gcc/config/i386/svr3gas.h @@ -255,7 +255,10 @@ dtors_section () \ else if (TREE_CODE (DECL) == VAR_DECL) \ { \ if ((0 && RELOC) /* should be (flag_pic && RELOC) */ \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \ + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ else \ const_section (); \ diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h index a0203b4dfda..6c41e4e3ffc 100644 --- a/gcc/config/m88k/m88k.h +++ b/gcc/config/m88k/m88k.h @@ -197,13 +197,13 @@ extern char * reg_names[]; Redefined in sysv4.h, and luna.h. */ #define VERSION_INFO1 "88open OCS/BCS, " #ifndef VERSION_INFO2 -#define VERSION_INFO2 "$Revision: 1.57 $" +#define VERSION_INFO2 "$Revision: 1.58 $" #endif #ifndef VERSION_STRING #define VERSION_STRING version_string #ifdef __STDC__ -#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.57 $ " __DATE__ +#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.58 $ " __DATE__ #else #define TM_RCS_ID "$What$" #endif /* __STDC__ */ @@ -2552,7 +2552,10 @@ sdata_section () \ if (SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0))) \ sdata_section (); \ else if ((flag_pic && RELOC) \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \ + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ else \ const_section (); \ diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index e9bd74490c6..bb20567bc2a 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -3528,7 +3528,10 @@ rdata_section () \ else if (TREE_CODE (DECL) != VAR_DECL) \ rdata_section (); \ \ - else if (!TREE_READONLY (DECL)) \ + else if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ \ else \ diff --git a/gcc/config/nextstep.h b/gcc/config/nextstep.h index 3fc507a2156..d6e7003cfe8 100644 --- a/gcc/config/nextstep.h +++ b/gcc/config/nextstep.h @@ -536,11 +536,19 @@ objc_section_init () \ else \ data_section (); \ } \ - else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \ - && !TREE_SIDE_EFFECTS (exp)) \ - readonly_data_section (); \ + else if (TREE_CODE (DECL) == VAR_DECL) \ + { \ + if ((flag_pic && RELOC) \ + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ + data_section (); \ + else \ + readonly_data_section (); \ + } \ else \ - data_section (); \ + readonly_data_section (); \ } \ while (0) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 0662d5562f2..3bd77cd369e 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1747,11 +1747,13 @@ toc_section () \ #define SELECT_SECTION(EXP,RELOC) \ { \ - if ((TREE_READONLY (EXP) \ - || (TREE_CODE (EXP) == STRING_CST \ - && !flag_writable_strings)) \ - && ! TREE_THIS_VOLATILE (EXP) \ - && ! (RELOC)) \ + if ((TREE_CODE (EXP) == STRING_CST \ + && !flag_writable_strings) \ + || (TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \ + && DECL_INITIAL (EXP) \ + && (DECL_INITIAL (EXP) == error_mark_node \ + || TREE_CONSTANT (DECL_INITIAL (EXP))) \ + && ! (RELOC))) \ { \ if (TREE_PUBLIC (EXP)) \ read_only_data_section (); \ diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 76611a9e29b..9fe8b82bab9 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -282,6 +282,9 @@ extern int target_flags; if (TREE_CODE (T) == VAR_DECL) \ { \ if (TREE_READONLY (T) && ! TREE_SIDE_EFFECTS (T) \ + && DECL_INITIAL (T) \ + && (DECL_INITIAL (T) == error_mark_node \ + || TREE_CONSTANT (DECL_INITIAL (T))) \ && DECL_ALIGN (T) <= MAX_TEXT_ALIGN \ && ! (flag_pic && (RELOC))) \ text_section (); \ diff --git a/gcc/config/svr3.h b/gcc/config/svr3.h index 9f8ddc1530b..94cefb44f3e 100644 --- a/gcc/config/svr3.h +++ b/gcc/config/svr3.h @@ -363,7 +363,10 @@ dtors_section () \ else if (TREE_CODE (DECL) == VAR_DECL) \ { \ if ((0 && RELOC) /* should be (flag_pic && RELOC) */ \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \ + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ else \ const_section (); \ diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h index 1cdf90c5c0a..9b5d15cdb9e 100644 --- a/gcc/config/svr4.h +++ b/gcc/config/svr4.h @@ -513,7 +513,10 @@ dtors_section () \ else if (TREE_CODE (DECL) == VAR_DECL) \ { \ if ((flag_pic && RELOC) \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)) \ + || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ else \ const_section (); \ diff --git a/gcc/config/vax/vms.h b/gcc/config/vax/vms.h index fc2ff4b4dc5..b6f2ebd0a0b 100644 --- a/gcc/config/vax/vms.h +++ b/gcc/config/vax/vms.h @@ -253,7 +253,10 @@ const_section () \ { \ if (TREE_CODE (T) == VAR_DECL) \ { \ - if (TREE_READONLY (T) && ! TREE_THIS_VOLATILE (T)) \ + if (TREE_READONLY (T) && ! TREE_THIS_VOLATILE (T) \ + && DECL_INITIAL (T) \ + && (DECL_INITIAL (T) == error_mark_node \ + || TREE_CONSTANT (DECL_INITIAL (T)))) \ { \ if (TREE_PUBLIC (T)) \ const_section (); \ |