diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1994-03-18 15:43:00 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1994-03-18 15:43:00 -0800 |
commit | ed8969fa7d85d9467bea0379ff4bca782708ac3f (patch) | |
tree | f0a28f279a86dda097db4b1543ece6ced2c93aa7 /gcc/config | |
parent | 07aeab22c0aa102a34c5fdd1b435964135271618 (diff) | |
download | gcc-ed8969fa7d85d9467bea0379ff4bca782708ac3f.zip gcc-ed8969fa7d85d9467bea0379ff4bca782708ac3f.tar.gz gcc-ed8969fa7d85d9467bea0379ff4bca782708ac3f.tar.bz2 |
(SELECT_SECTION): Variables go in readonly data
only if the initializer is constant.
From-SVN: r6820
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 858c277..14f4b95 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 d6b0d95..cafbdd5 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 a0203b4..6c41e4e 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 e9bd744..bb20567 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 3fc507a..d6e7003 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 0662d55..3bd77cd 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 76611a9..9fe8b82 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 9f8ddc1..94cefb4 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 1cdf90c..9b5d15c 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 fc2ff4b..b6f2ebd 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 (); \ |