This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR33168, ppc64 bootstrap failure


This patch from Segher fixes the bootstrap failure on ppc64.

Bootstrapped and tested on x86_64-unknown-linux-gnu, i686-pc-linux-gnu,
ia64-unknown-linux-gnu and ppc-unknown-linux-gnu, built on 
ppc64-unknown-linux-gnu.

Ok for mainline?  Segher, would you please add a ChangeLog entry? ;)

(I added parantheses around the XOR compared to the original patch)

Thanks,
Richard.

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c	(revision 124742)
+++ gcc/varasm.c	(working copy)
@@ -537,10 +537,20 @@
   else
     {
       sect = *slot;
+
+      /* Sanity check user variables for flag changes.  */
       if ((sect->common.flags & ~SECTION_DECLARED) != flags
 	  && ((sect->common.flags | flags) & SECTION_OVERRIDE) == 0)
 	{
-	  /* Sanity check user variables for flag changes.  */
+	  /* Allow mixed writable and read-only objects in named sections.  */
+	  if ((sect->common.flags & SECTION_NAMED) != 0
+	      && (sect->common.flags & ~SECTION_DECLARED)
+	      == (flags ^ SECTION_WRITE))
+	    {
+	      sect->common.flags |= SECTION_WRITE;
+	      return sect;
+	    }
+
 	  if (decl == 0)
 	    decl = sect->named.decl;
 	  gcc_assert (decl);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]