From patchwork Thu Jun 14 23:21:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 165026 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 4E33DB7023 for ; Fri, 15 Jun 2012 09:22:11 +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=1340320932; 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=J/cl5njBrlP6UhXydqMtP5FVzBg=; b=siZAb4solsugf8j tPREP4xY/8rP2NHvadURryUFMYNwkKf7hCAYFpqOf5QWycJBgxWQxYELKqmYVcpt 6/32qhWmUKsIcrg42G190wJKnm+Dx6GeZfXiydNJpD6qrB4UeGT15lMcgv9zsPxe Gy/pqQFSxNEAZhqFg9gqbXLAsM2U= 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=K1y/iRNmy8YxUdvB80Z++eN2w8PGZWrA+rYSBysHBPKCxX2UdzKkZ2YoGQ2bWo pLrNTH4eA4NsdDte21hkP0Wrfi+L/wtDXpFMN9jFidYQXhPLLjnToS8yYdm03RCQ aEO9tYRYEMklPwXCnsaZqGKkWbiJ1usRIisdFf+XWYeSI=; Received: (qmail 1476 invoked by alias); 14 Jun 2012 23:22:04 -0000 Received: (qmail 1467 invoked by uid 22791); 14 Jun 2012 23:22:03 -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-gg0-f175.google.com (HELO mail-gg0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jun 2012 23:21:51 +0000 Received: by ggnp4 with SMTP id p4so1935709ggn.20 for ; Thu, 14 Jun 2012 16:21:50 -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=Yax2Is489neZgUZNkYoeZ+g4jP0XxH1Gt9n+kdbH4Co=; b=dcLUD39QctmQaCtANPJ8x70Z5hjHZcM3wB1uw/6d0ScfRE2wQSu2821u/PF+qquvgE UXW+6eiCW1ATSuydcOTF2mYjXP0YohdDBZjPyE4FhGOJo7DQT80eHJA9SAWjKe58PCOL /zGSDH3QgMguVJ11fwTqM6QiWn+dYyK2cYTjLrP58Mcz61YJJ4GE32KgNZFLZX8bmb1r 4HlIuRdA7ApslLWwzH7QhUCQ2HuavdVD4+7OvSmBss5kNF0gy7x4LW3XB9XLp9RJC3DU d7jDx2UZunhbtshMDK2Jc9JDX6wkaMiktSfdLM6jo4c22MuXPFDi6uDFllGX+pMHiY8Y H8Eg== Received: by 10.50.219.162 with SMTP id pp2mr13956549igc.40.1339716110044; Thu, 14 Jun 2012 16:21:50 -0700 (PDT) Received: by 10.50.219.162 with SMTP id pp2mr13956543igc.40.1339716109925; Thu, 14 Jun 2012 16:21:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.24.166 with HTTP; Thu, 14 Jun 2012 16:21:29 -0700 (PDT) In-Reply-To: References: From: Roland McGrath Date: Thu, 14 Jun 2012 16:21:29 -0700 Message-ID: Subject: Re: [PATCH] ARM: exclude fixed_regs for stack-alignment save/restore To: Mike Stump Cc: gcc-patches@gcc.gnu.org X-System-Of-Record: true X-Gm-Message-State: ALoCoQkbXk4Gs/qVyfLtCkyB/+jjSiKnzOta8Jt24JUzgZp2xsJMY2dulundlXSs5GuroerTkBOqUJml2QykYYUx2FTdUd+jWd7WVijn/L773QfWXtGz/7cC8fHoa1alQdvrr+y8sAUYp63S3fCOHLAyb7oFQlUmUw== 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 Here's the version of the change that incorporates Mike's suggestion. Thanks, Roland gcc/ 2012-06-14 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 092e202..13771d9 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -16752,7 +16752,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] && !global_regs[i] + && (offsets->saved_regs_mask & (1 << i)) == 0) { reg = i; break;