diff mbox series

[committed] Fix thousands of testsuite failures for the c6x

Message ID 26c15b83-5f3c-224c-edbe-67d9f4735308@redhat.com
State New
Headers show
Series [committed] Fix thousands of testsuite failures for the c6x | expand

Commit Message

Jeff Law July 12, 2019, 3:41 p.m. UTC
My tester reports ~22000 unexpected failures for the c6x port.  The vast
majority are due to a linker warning when the type of the .far section
changes.

It turns out we can emit two declarations for the .far section.  One
with @nobits, the other without.  And since the .far section is a bss
section the linker complains.  Those complaints are picked up by dejagnu
and thus every test that links fails.

This patch clears the SECTION_NOTYPE flag for the .far section in the
path that declares the .far section without the @nobits tag.  The net
result is we go from ~22000 failures to just several hundred (note I'm
using a dummy simulator that always signals success -- so it's not
testing code correctness, just that we can compile/link).

Committed to the trunk.

Jeff
commit 713c53b30d7b74df412c89a11f4714e0ca08ee22
Author: Jeff Law <law@redhat.com>
Date:   Fri Jul 12 09:40:16 2019 -0600

            * config/c6x/c6x.c (c6x_section_type): Clear SECTION_NOTYPE
            for the ".far" section.
diff mbox series

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 84fee9e0dd9..4f32256c8d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-07-12  Jeff Law  <law@redhat.com>
+
+	* config/c6x/c6x.c (c6x_section_type): Clear SECTION_NOTYPE
+	for the ".far" section.
+
 2019-07-12  Richard Biener  <rguenther@suse.de>
 
 	PR tree-optimization/91145
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 93841e4abef..f6c9bbfc674 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -1083,6 +1083,14 @@  c6x_section_type_flags (tree decl, const char *name, int reloc)
 
   flags |= default_section_type_flags (decl, name, reloc);
 
+  /* The ".far" section will be declared with @nobits elsewhere.
+     But when declared via this path it will not have the @nobits
+     flag because of SECTION_NOTYPE.  This causes linker warnings
+     due to the mismatched attribute.  Clearing SECTION_NOTYPE
+     for the ".far" section is sufficient to fix this problem.  */
+  if (strcmp (name, ".far") == 0)
+    flags &= ~SECTION_NOTYPE;
+
   return flags;
 }