diff options
author | jconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-12 15:46:35 +0000 |
---|---|---|
committer | jconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-12 15:46:35 +0000 |
commit | 5f9018a7490f287bbeaa99e5c25426f3d5435aac (patch) | |
tree | c79859549d5743661c5f45b4cd49573fdeb65f79 /gcc/ipa-reference.c | |
parent | e241195212d7c1a3b5e065764bae206d69e40a67 (diff) | |
download | gcc-5f9018a7490f287bbeaa99e5c25426f3d5435aac.tar.gz |
pr middle-end/23237
* ipa-reference.c (static_execute): Don't mark variables in
named sections TREE_READONLY.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104176 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r-- | gcc/ipa-reference.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index f2f9252e8ac..531705226a5 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -963,10 +963,17 @@ static_execute (void) EXECUTE_IF_SET_IN_BITMAP (module_statics_readonly, 0, index, bi) { tree var = get_static_decl (index); - TREE_READONLY (var) = 1; - if (dump_file) - fprintf (dump_file, "read-only var %s\n", - get_static_name (index)); + + /* Ignore variables in named sections - changing TREE_READONLY + changes the section flags, potentially causing conflicts with + other variables in the same named section. */ + if (DECL_SECTION_NAME (var) == NULL_TREE) + { + TREE_READONLY (var) = 1; + if (dump_file) + fprintf (dump_file, "read-only var %s\n", + get_static_name (index)); + } if (DECL_INITIAL (var) && is_gimple_min_invariant (DECL_INITIAL (var))) { |