This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix PR 33168
On Mon, Aug 27, 2007 at 03:53:07PM +0200, Paolo Bonzini wrote:
> if (compare_section_name (section, ".sdata")
> || compare_section_name (section, ".sdata2")
> || compare_section_name (section, ".gnu.linkonce.s")
> || compare_section_name (section, ".sbss")
> || compare_section_name (section, ".sbss2")
> || compare_section_name (section, ".gnu.linkonce.sb")
> || !strcmp (section, ".PPC.EMB.sdata0")
> || !strcmp (section, ".PPC.EMB.sbss0"))
>
> (It also passes for "naked" .gnu.linkonce.s{,b} which I'd say should not
> be a problem).
The patch as committed unfortunately returns true if any of
the compare_section_name calls returns false, i.e. always
for any VAR_DECL with DECL_SECTION_NAME (decl) != NULL.
This breaks e.g.
+FAIL: gcc.dg/20051207-3.c (test for errors, line 7)
or the whole libstdc++-v3 testsuite:
Running target unix
-FAIL: abi_check
-XPASS: 26_numerics/headers/cmath/c99_classification_macros_c.cc (test for excess errors)
+ERROR: tcl error sourcing /usr/src/gcc/libstdc++-v3/testsuite/libstdc++-abi/abi.exp.
+ERROR: could not compile testsuite_abi.cc
+ERROR: tcl error sourcing /usr/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
+ERROR: could not compile testsuite_abi.cc
I'll commit the following fix as obvious when my bootstrap/regression
testing completes.
2007-08-30 Jakub Jelinek <jakub@redhat.com>
PR target/33168
* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Return
true if any of the compare_section_name calls returned true,
rather than if any returned false.
--- gcc/config/rs6000/rs6000.c.jj 2007-08-30 02:01:14.000000000 +0200
+++ gcc/config/rs6000/rs6000.c 2007-08-30 11:16:52.000000000 +0200
@@ -19263,12 +19263,12 @@ rs6000_elf_in_small_data_p (const_tree d
if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl))
{
const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
- if (compare_section_name (section, ".sdata") == 0
- || compare_section_name (section, ".sdata2") == 0
- || compare_section_name (section, ".gnu.linkonce.s") == 0
- || compare_section_name (section, ".sbss") == 0
- || compare_section_name (section, ".sbss2") == 0
- || compare_section_name (section, ".gnu.linkonce.sb") == 0
+ if (compare_section_name (section, ".sdata")
+ || compare_section_name (section, ".sdata2")
+ || compare_section_name (section, ".gnu.linkonce.s")
+ || compare_section_name (section, ".sbss")
+ || compare_section_name (section, ".sbss2")
+ || compare_section_name (section, ".gnu.linkonce.sb")
|| strcmp (section, ".PPC.EMB.sdata0") == 0
|| strcmp (section, ".PPC.EMB.sbss0") == 0)
return true;
Jakub