From: Andreas Fischer Date: Sat, 27 Nov 2004 22:57:09 +0000 (+0000) Subject: re PR target/16343 (invalid code when using -meabi -msdata=eabi) X-Git-Tag: releases/gcc-3.4.4~478 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01dd62e953d5084c68b01269dbba3bc018cdd605;p=thirdparty%2Fgcc.git 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 From-SVN: r91398 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aeabbf3e94a4..6717fe694e1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-11-28 Andreas Fischer + Alan Modra + + PR target/16343 + * config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Disallow + functions, strings and thread-local vars. + 2004-11-27 Alan Modra PR target/12769 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 4e48dffe9990..197878b57326 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -15211,6 +15211,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));