From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62731 invoked by alias); 12 Oct 2015 17:38:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 62660 invoked by uid 89); 12 Oct 2015 17:38:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,NO_DNS_FOR_FROM,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Oct 2015 17:38:34 +0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 12 Oct 2015 10:38:18 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.52]) by FMSMGA003.fm.intel.com with ESMTP; 12 Oct 2015 10:38:17 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id 16A60C3919; Mon, 12 Oct 2015 10:38:17 -0700 (PDT) Date: Mon, 12 Oct 2015 17:38:00 -0000 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [committed, PATCH] [gcc-5-branch] Wrong stack alignment adjustment Message-ID: <20151012173817.GA14451@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2015-10/txt/msg01160.txt.bz2 Committed as an obvious fix. H.J. --- Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 228731) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,10 @@ +2015-10-12 H.J. Lu + + PR target/67940 + * config/i386/i386.c (ix86_compute_frame_layout): Correct + stack alignment adjustment. + (ix86_expand_prologue): Likewise. + 2015-10-12 Uros Bizjak Backport from mainline Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 228731) +++ gcc/config/i386/i386.c (working copy) @@ -10222,7 +10222,7 @@ ix86_compute_frame_layout (struct ix86_f sure that no value happens to be the same before and after, force the alignment computation below to add a non-zero value. */ if (stack_realign_fp) - offset = (offset + stack_alignment_needed) & -stack_alignment_needed; + offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed; /* Va-arg area */ frame->va_arg_size = ix86_varargs_gpr_size + ix86_varargs_fpr_size; @@ -11613,7 +11613,7 @@ ix86_expand_prologue (void) pointer is no longer valid. As for the value of sp_offset, see ix86_compute_frame_layout, which we need to match in order to pass verification of stack_pointer_offset at the end. */ - m->fs.sp_offset = (m->fs.sp_offset + align_bytes) & -align_bytes; + m->fs.sp_offset = (m->fs.sp_offset + align_bytes - 1) & -align_bytes; m->fs.sp_valid = false; }