From patchwork Thu Oct 20 15:34:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 120830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AB0A3B6F89 for ; Fri, 21 Oct 2011 02:34:34 +1100 (EST) Received: from localhost ([::1]:39183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGudb-0005SW-P1 for incoming@patchwork.ozlabs.org; Thu, 20 Oct 2011 11:34:31 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGudP-0005Qc-GQ for qemu-devel@nongnu.org; Thu, 20 Oct 2011 11:34:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGudO-0000EI-4l for qemu-devel@nongnu.org; Thu, 20 Oct 2011 11:34:19 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:41854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGudN-0000EA-P2 for qemu-devel@nongnu.org; Thu, 20 Oct 2011 11:34:18 -0400 Received: by vws17 with SMTP id 17so2421278vws.4 for ; Thu, 20 Oct 2011 08:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=532XHvtov9t9zBp5QUeklxf1I2uXe5m1oOy3JWJ8gIo=; b=JzWoYcBnPoEt2YW3Qvk4AFRQAZtTDaHyiA/cCnaKRoXjvj4RaHJeEsVlmPzfJ2gVVM 3FrKzM2aTmWQTj6IquunEeL3vkf7k5rMuhBAw8rT3jhZnpZMC2SiwIQ2zeKeNy7D8wPc 1RQTkRVZjje9nAEGjXGMTpZ6MAt9ko3515+0Y= MIME-Version: 1.0 Received: by 10.52.22.9 with SMTP id z9mr10967146vde.59.1319124856735; Thu, 20 Oct 2011 08:34:16 -0700 (PDT) Received: by 10.220.181.131 with HTTP; Thu, 20 Oct 2011 08:34:16 -0700 (PDT) In-Reply-To: References: <4E9BB180.6080506@mc.net> <4E9C0497.2000605@siriusit.co.uk> <4E9C3703.3040109@mc.net> <4E9C645A.5060200@twiddle.net> <4E9C9C08.20001@mc.net> <4E9CAACE.4070804@mc.net> <4E9F3BB4.3050604@mc.net> Date: Thu, 20 Oct 2011 17:34:16 +0200 Message-ID: From: Kai Tietz To: xunxun X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.45 Cc: "gcc@gcc.gnu.org" , Bob Breuer , qemu-devel , Mark Cave-Ayland , Richard Henderson Subject: Re: [Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi, For trunk-version I have a tentative patch for this issue. On 4.6.x and older branches this doesn't work, as here we can't differenciate that easy between ms- and sysv-abi. But could somebody give this patch a try? Regards, Kai ChangeLog * config/i386/i386.c (ix86_frame_pointer_required): Enforce use of frame-pointer for 32-bit ms-abi, if setjmp is used. Index: i386.c =================================================================== --- i386.c (revision 180099) +++ i386.c (working copy) @@ -8391,6 +8391,10 @@ if (SUBTARGET_FRAME_POINTER_REQUIRED) return true; + /* For older 32-bit runtimes setjmp requires valid frame-pointer. */ + if (TARGET_32BIT_MS_ABI && cfun->calls_setjmp) + return true; + /* In ix86_option_override_internal, TARGET_OMIT_LEAF_FRAME_POINTER turns off the frame pointer by default. Turn it back on now if we've not got a leaf function. */