From patchwork Tue Jan 18 21:26:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 79363 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 8EC93B70FF for ; Wed, 19 Jan 2011 08:29:40 +1100 (EST) Received: (qmail 14525 invoked by alias); 18 Jan 2011 21:29:39 -0000 Received: (qmail 14517 invoked by uid 22791); 18 Jan 2011 21:29:39 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Jan 2011 21:29:34 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 7072DCB0267; Tue, 18 Jan 2011 22:29:32 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TSN5Qc-CPL82; Tue, 18 Jan 2011 22:29:32 +0100 (CET) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 02116CB0260; Tue, 18 Jan 2011 22:29:32 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Re: [patch] Fix PR middle-end/46894 Date: Tue, 18 Jan 2011 22:26:59 +0100 User-Agent: KMail/1.9.9 Cc: IainS , Richard Henderson References: <201101131720.52843.ebotcazou@adacore.com> <201101151300.05086.ebotcazou@adacore.com> In-Reply-To: <201101151300.05086.ebotcazou@adacore.com> MIME-Version: 1.0 Message-Id: <201101182226.59585.ebotcazou@adacore.com> 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 my proposal: let's fix the regression by applying my original patch > and open a new PR with Richard's patch attached and 4.7 as target > milestone. I've installed the attached patch after bootstrap/regtest on x86_64-suse-linux and opened PR middle-end/47353 to track the S_P_O pessimization. Index: explow.c =================================================================== --- explow.c (revision 168903) +++ explow.c (working copy) @@ -1148,6 +1148,7 @@ allocate_dynamic_stack_space (rtx size, { HOST_WIDE_INT stack_usage_size = -1; rtx final_label, final_target, target; + unsigned extra_align = 0; bool must_align; /* If we're asking for zero bytes, it doesn't matter what we point @@ -1231,21 +1232,25 @@ allocate_dynamic_stack_space (rtx size, that might result from the alignment operation. */ must_align = (crtl->preferred_stack_boundary < required_align); -#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET) - must_align = true; -#endif - if (must_align) { - unsigned extra, extra_align; - if (required_align > PREFERRED_STACK_BOUNDARY) extra_align = PREFERRED_STACK_BOUNDARY; else if (required_align > STACK_BOUNDARY) extra_align = STACK_BOUNDARY; else extra_align = BITS_PER_UNIT; - extra = (required_align - extra_align) / BITS_PER_UNIT; + } + + /* ??? STACK_POINTER_OFFSET is always defined now. */ +#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET) + must_align = true; + extra_align = BITS_PER_UNIT; +#endif + + if (must_align) + { + unsigned extra = (required_align - extra_align) / BITS_PER_UNIT; size = plus_constant (size, extra); size = force_operand (size, NULL_RTX);