diff options
author | Andreas Fischer <a_fisch@gmx.de> | 2004-11-27 22:51:43 +0000 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2004-11-28 09:21:43 +1030 |
commit | 7482ad259b15635788b1069dcfc6c8dca402f922 (patch) | |
tree | d60ce0bb36736566c8201f526b77601568623f11 | |
parent | f57fe06890a3f6072b1d993432cbee19bd7e7e21 (diff) | |
download | gcc-7482ad259b15635788b1069dcfc6c8dca402f922.zip gcc-7482ad259b15635788b1069dcfc6c8dca402f922.tar.gz gcc-7482ad259b15635788b1069dcfc6c8dca402f922.tar.bz2 |
re PR target/16343 (invalid code when using -meabi -msdata=eabi)
PR target/16343
* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow
functions, strings and thread-local vars.
Co-Authored-By: Alan Modra <amodra@bigpond.net.au>
From-SVN: r91397
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c805f3..6def113 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-11-28 Andreas Fischer <a_fisch@gmx.de> + Alan Modra <amodra@bigpond.net.au> + + PR target/16343 + * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow + functions, strings and thread-local vars. + 2004-11-28 Alan Modra <amodra@bigpond.net.au> * config/rs6000/rs6000.h (WORLD_SAVE_P): Define. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5a7bd84..ca919b3 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -17263,6 +17263,18 @@ rs6000_elf_in_small_data_p (tree decl) if (rs6000_sdata == SDATA_NONE) return false; + /* We want to merge strings, so we never consider them small data. */ + if (TREE_CODE (decl) == STRING_CST) + return false; + + /* Functions are never in the small data area. */ + if (TREE_CODE (decl) == FUNCTION_DECL) + return false; + + /* Thread-local vars can't go in the small data area. */ + if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) + return false; + if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl)) { const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); |