From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22702 invoked by alias); 2 Feb 2011 11:23:28 -0000 Received: (qmail 22693 invoked by uid 22791); 2 Feb 2011 11:23:28 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Feb 2011 11:23:23 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/47581] [4.6 regression] Unnecessary adjustments to stack pointer X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 02 Feb 2011 11:23:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00260.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47581 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek 2011-02-02 11:23:18 UTC --- Before Richard's commit apparently expand_one_var wasn't updating stack_alignment_needed, just stack_alignment_estimated, now it updates both. As PREFERRED_STACK_BOUNDARY is 128 (the default), ix86_minimum_alignment: if (TARGET_64BIT || align != 64 || ix86_preferred_stack_boundary >= 64) return align; returns 64 instead of 32. So, to fix this, either the stack_alignment_needed updating in expand_one_var isn't strictly necessary and we could undo that part of the changes. Or return 32 as MINIMUM_ALIGNMENT for DImode long long even for ix86_preferred_stack_boundary >= 64. Or we could perhaps the /* Align start of frame for local function. */ offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed; in ix86_compute_frame_layout perform only if if (offset != frame->sse_reg_save_offset || size != 0 || !current_function_is_leaf || cfun->calls_alloca || ix86_current_function_calls_tls_descriptor) (i.e. if frame size is 0 and no outgoing calls, it doesn't make sense to align).