From patchwork Wed Oct 12 07:07:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 119148 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 BD939B6F6F for ; Wed, 12 Oct 2011 18:07:46 +1100 (EST) Received: (qmail 20634 invoked by alias); 12 Oct 2011 07:07:43 -0000 Received: (qmail 20623 invoked by uid 22791); 12 Oct 2011 07:07:41 -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-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Oct 2011 07:07:25 +0000 Received: by vwe42 with SMTP id 42so346660vwe.20 for ; Wed, 12 Oct 2011 00:07:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.31.41 with SMTP id x9mr22052232vdh.42.1318403244207; Wed, 12 Oct 2011 00:07:24 -0700 (PDT) Received: by 10.220.180.5 with HTTP; Wed, 12 Oct 2011 00:07:24 -0700 (PDT) Date: Wed, 12 Oct 2011 09:07:24 +0200 Message-ID: Subject: [patch i386]: Unbreak bootstrap for x64 SEH enabled 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, by recent changes gcc begun to move code into the prologue region. This is for x64 SEH an issue, as here the table-information for prologue is limited to 255 bytes size. So we need to avoid moving additional code into prologue. To achieve this we mark all standard and xmm registers as prologue-used at the end of prologue. Also we need to emit a memory blockage. ChangeLog 2011-10-12 Kai Tietz * config/i386/i386.c (ix86_expand_prologue): Mark for TARGET_SEH all sse/integer registers as prologue-used. Tested for x86_64-w64-mingw32. Ok for apply? Regards, Kai Index: i386.c =================================================================== --- i386.c (revision 179824) +++ i386.c (working copy) @@ -10356,7 +10356,24 @@ Further, prevent alloca modifications to the stack pointer from being combined with prologue modifications. */ if (TARGET_SEH) - emit_insn (gen_prologue_use (stack_pointer_rtx)); + { + int i; + + /* Due limited size of prologue-code size of 255 bytes, + we need to prevent scheduler to sink instructions into + prologue code. Therefore we mark all standard, sse, fpu, + and the pc registers as prologue-used to prevent this. + Also an memory-blockage is necessary. */ + emit_insn (gen_memory_blockage ()); + + for (i = 0; i <= 7; i++) + { + emit_insn (gen_prologue_use (gen_rtx_REG (Pmode, AX_REG + i))); + emit_insn (gen_prologue_use (gen_rtx_REG (Pmode, R8_REG + i))); + emit_insn (gen_prologue_use (gen_rtx_REG (TImode, XMM0_REG + i))); + emit_insn (gen_prologue_use (gen_rtx_REG (TImode, XMM8_REG + i))); + } + } } /* Emit code to restore REG using a POP insn. */