From patchwork Thu Aug 4 20:53:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 108568 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 8C35CB6F77 for ; Fri, 5 Aug 2011 06:54:18 +1000 (EST) Received: (qmail 29358 invoked by alias); 4 Aug 2011 20:54:14 -0000 Received: (qmail 29345 invoked by uid 22791); 4 Aug 2011 20:54:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 20:53:58 +0000 Received: by qyk4 with SMTP id 4so661363qyk.20 for ; Thu, 04 Aug 2011 13:53:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.68.12 with SMTP id t12mr1025549qci.254.1312491237343; Thu, 04 Aug 2011 13:53:57 -0700 (PDT) Received: by 10.229.99.137 with HTTP; Thu, 4 Aug 2011 13:53:57 -0700 (PDT) Date: Thu, 4 Aug 2011 22:53:57 +0200 Message-ID: Subject: [patch i386]: Fix recent bootstrap failure for x86_64 windows target From: Kai Tietz To: GCC Patches Cc: Richard Henderson X-IsSubscribed: yes 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 Hello, recently we got a bootstrap failure in libfortran's transfer.c:sset function. This is caused by optimizing alloca into prologue. This can cause for x64 with SEH to too large prologue-frame-size for SEH information. This patch simply assumes that iff the function is using an alloca call, then we should set frame's hard_frame_pointer_offset to its current stack_pointer_offset (minus 128 delta for smaller common stack-address ranges). ChangeLog 2011-08-04 Kai Tietz * config/i386/i386.c (ix86_compute_frame_layout): Adjust hard_frame_pointer_offset if function uses alloca. Regression test in progress. Ok for apply after successful test? Regards, Kai Index: i386.c =================================================================== --- i386.c (revision 177412) +++ i386.c (working copy) @@ -8860,7 +8860,7 @@ /* If we can leave the frame pointer where it is, do so. */ diff = frame->stack_pointer_offset - frame->hard_frame_pointer_offset; - if (diff > 240 || (diff & 15) != 0) + if (diff > 240 || (diff & 15) != 0 || cfun->calls_alloca != 0) { /* Ideally we'd determine what portion of the local stack frame (within the constraint of the lowest 240) is most heavily used.