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]

Restore Tru64 UNIX bootstrap (PR middle-end/46671)


Jan's patch

	Re: Group static constructors and destructors in specific subsections, take 2
        http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00983.html

broke bootstrap on every target without named sections since varasm.c
(default_function_section) assumes they exist.  While two port
maintainers so far have worked around the breakage in their ports
(pdp11, hppa) since Jan completely failed to address (or even
acknowledge) the breakage he's caused, I think the fix belongs into
default_function_section to make that function an appropriate default.

The patch below does this, and also includes another obvious fix to
allow the bootstrap to continue.  Bootstrap has finished with the
patch.  While testing is still underway, there were no unusual testsuite
failures so far.

Ok for mainline?

	Rainer


2010-12-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR middle-end/46671
	* varasm.c (default_function_section): Return NULL unless
	targetm.have_named_sections.

	* regrename.c (check_new_reg_p): Mark reg with ATTRIBUTE_UNUSED.

diff -r 0168da119e76 gcc/regrename.c
--- a/gcc/regrename.c	Fri Dec 10 17:50:52 2010 +0100
+++ b/gcc/regrename.c	Fri Dec 10 17:52:57 2010 +0100
@@ -309,8 +309,8 @@
    registers.  */
 
 static bool
-check_new_reg_p (int reg, int new_reg,  struct du_head *this_head,
-		 HARD_REG_SET this_unavailable)
+check_new_reg_p (int reg ATTRIBUTE_UNUSED, int new_reg,
+		 struct du_head *this_head, HARD_REG_SET this_unavailable)
 {
   enum machine_mode mode = GET_MODE (*this_head->first->loc);
   int nregs = hard_regno_nregs[new_reg][mode];
diff -r 0168da119e76 gcc/varasm.c
--- a/gcc/varasm.c	Fri Dec 10 17:50:52 2010 +0100
+++ b/gcc/varasm.c	Fri Dec 10 17:52:57 2010 +0100
@@ -533,6 +533,9 @@
 default_function_section (tree decl, enum node_frequency freq,
 			  bool startup, bool exit)
 {
+  if (!targetm.have_named_sections)
+    return NULL;
+
   /* Startup code should go to startup subsection unless it is
      unlikely executed (this happens especially with function splitting
      where we can split away unnecesary parts of static constructors.  */


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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