From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19752 invoked by alias); 22 Oct 2011 14:21:03 -0000 Received: (qmail 19741 invoked by uid 22791); 22 Oct 2011 14:21:02 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_DB,TW_GJ,TW_TJ X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 22 Oct 2011 14:20:48 +0000 Received: by iafi7 with SMTP id i7so6460516iaf.20 for ; Sat, 22 Oct 2011 07:20:47 -0700 (PDT) Received: by 10.42.157.3 with SMTP id b3mr30271512icx.44.1319293247629; Sat, 22 Oct 2011 07:20:47 -0700 (PDT) Received: from [192.168.1.102] ([115.205.115.232]) by mx.google.com with ESMTPS id jm11sm43006274ibb.1.2011.10.22.07.20.34 (version=SSLv3 cipher=OTHER); Sat, 22 Oct 2011 07:20:46 -0700 (PDT) Message-ID: <4EA2D1EB.4060106@gmail.com> Date: Sat, 22 Oct 2011 22:59:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Kai Tietz CC: xunxun , Bob Breuer , "gcc@gcc.gnu.org" , Richard Henderson , qemu-devel , Mark Cave-Ayland Subject: Re: gcc auto-omit-frame-pointer vs msvc longjmp 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00403.txt.bz2 On 2011-10-20 23:34, Kai Tietz wrote: > 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. */ > I just see two related links about this issue: see: http://stackoverflow.com/questions/5887552/setjmp-and-omit-frame-pointer and http://connect.microsoft.com/VisualStudio/feedback/details/666704/visual-c-generates-incorrect-code-with-omit-frame-pointer-and-setjmp I'm not sure microsoft has fix this issue. asmwarrior ollydbg from codeblocks' forum