From patchwork Tue Jul 17 20:42:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 171557 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 3AB702C00C1 for ; Wed, 18 Jul 2012 06:42:49 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343162570; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:MIME-Version:Received:In-Reply-To:References:From:Date: Message-ID:Subject:To:Cc:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=C0v8ZNv1pFxe23qggMrs0PzHo0Q=; b=brN/FNifzTLddhs mb9xTyV2Ui5gXfP1eZyHLl1V45fCHhf9NcEStSawtzoKQMMLHN1W/LgNLJZSalG4 BWMBJ3RXFu69fD66AV2rTwOAovAn8+ZrAD34GyHkM97fMPeZ3nUSHelGvDka1beg 3FoPZhczMQhLnx7bkHwLOqPFiG2A= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:MIME-Version:Received:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:X-System-Of-Record:X-Gm-Message-State:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Yh2aKGCOYJsm6Nhi+z0ftvI4dpdyxkZIqWjaH7Bz8aSS026VAVlZXSyKMSpmcf 59jvtfKEABwe01s5CFsX6+N5ZaT9pINUXLvo7CMOYKNbP3AiDIwTTz8hi0BO8UEl 5uQTo+BMWjwbKP7r4/4zRZYUhavMHi59nWv7Utz1WPChQ=; Received: (qmail 15109 invoked by alias); 17 Jul 2012 20:42:45 -0000 Received: (qmail 15101 invoked by uid 22791); 17 Jul 2012 20:42:44 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f54.google.com (HELO mail-qa0-f54.google.com) (209.85.216.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 20:42:31 +0000 Received: by qaat11 with SMTP id t11so594829qaa.20 for ; Tue, 17 Jul 2012 13:42:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=QVAfrFed92af9qFpV83AwdfZuClhoIGBwvc0kcwTU3w=; b=i5j7qv2Ma/xK8W1LlnglTLiOeZVp/arR/4sss3pxmKJLshRKqv2+RcMHN3fbe4w24u dVExicBQS92Xinm6+CO+z2ZnEGFV538FgaKlunGVZEjiX6hB8CqPVnrTSE9UxsNC6ZJj mNUY6bbknsu2rvOKRJXnV5ZE1whQYAjdYGywxR+VSx/FgfInNwUR3NMLlf1abCUSXmsW BMs4YzWCQye2zHiXH0ro7bNNwV+wLTfm6XCpksju7bxc001poAdKpxZkJKbv7XIkUXA4 DdJZ8QZ6QbfXvcfr8QH7+OuQgFZeKwGzfAIYD6tstFxHhxVOcAlkrNjCcIAysGoTWiyT fdRw== Received: by 10.224.101.193 with SMTP id d1mr1821361qao.20.1342557750966; Tue, 17 Jul 2012 13:42:30 -0700 (PDT) Received: by 10.224.101.193 with SMTP id d1mr1821347qao.20.1342557750868; Tue, 17 Jul 2012 13:42:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.106.91 with HTTP; Tue, 17 Jul 2012 13:42:09 -0700 (PDT) In-Reply-To: References: <87txyba0mo.fsf@talisman.home> <4FDF4273.3040702@arm.com> From: Roland McGrath Date: Tue, 17 Jul 2012 13:42:09 -0700 Message-ID: Subject: Re: [PATCH] ARM: exclude fixed_regs for stack-alignment save/restore To: Richard Earnshaw Cc: gcc-patches@gcc.gnu.org X-System-Of-Record: true X-Gm-Message-State: ALoCoQmIj/pK1Ow11jOqbisFL3sl3NFndqoBqi/PpioLyk14M0PXPpZNrveXN26QicspJB/9MRGF8sCB4ykiIBxY6mL5Q0h5qMcCAZXOa9hkHiSlCpk+gLNe1gznMGYA517wmhwUeN07E8eVXTo/j5zzWuZKqrvKwLhQ245SLEX6NcOaVLtbae/6c4RaYAIQGOyUr95J/bfi 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 Richard, here is the patch against the current trunk, as I promised last week in Prague. Please apply. Thanks, Roland gcc/ 2012-07-17 Roland McGrath * config/arm/arm.c (arm_get_frame_offsets): Never use a fixed register as the extra register to save/restore for stack-alignment padding. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index e2f625c..189f71e 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -16121,7 +16121,12 @@ arm_get_frame_offsets (void) else for (i = 4; i <= (TARGET_THUMB1 ? LAST_LO_REGNUM : 11); i++) { - if ((offsets->saved_regs_mask & (1 << i)) == 0) + /* While the gratuitous register save/restore is ordinarily + harmless, if a register is marked as fixed or global it + may be entirely forbidden by the system ABI to touch it, + so we should avoid those registers. */ + if (!fixed_regs[i] + && (offsets->saved_regs_mask & (1 << i)) == 0) { reg = i; break;