From patchwork Fri Dec 10 17:29:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 75113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 554E0B70A5 for ; Sat, 11 Dec 2010 04:29:26 +1100 (EST) Received: (qmail 30100 invoked by alias); 10 Dec 2010 17:29:24 -0000 Received: (qmail 30088 invoked by uid 22791); 10 Dec 2010 17:29:23 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Dec 2010 17:29:18 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 14D0D98D; Fri, 10 Dec 2010 18:29:16 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hgnoW7Ow6f-Z; Fri, 10 Dec 2010 18:29:14 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id F18EC98C; Fri, 10 Dec 2010 18:29:13 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id oBAHTCGa006544; Fri, 10 Dec 2010 18:29:12 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka , John David Anglin , Paul Koning Subject: Restore Tru64 UNIX bootstrap (PR middle-end/46671) Date: Fri, 10 Dec 2010 18:29:12 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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. */