From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18115 invoked by alias); 17 Oct 2011 19:15:27 -0000 Received: (qmail 18106 invoked by uid 22791); 17 Oct 2011 19:15:26 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_GJ,TW_TJ X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Oct 2011 19:15:10 +0000 Received: by qam2 with SMTP id 2so757599qam.20 for ; Mon, 17 Oct 2011 12:15:09 -0700 (PDT) Received: by 10.182.73.67 with SMTP id j3mr11998307obv.46.1318878909105; Mon, 17 Oct 2011 12:15:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.121.8 with HTTP; Mon, 17 Oct 2011 12:14:49 -0700 (PDT) In-Reply-To: <4E9C645A.5060200@twiddle.net> References: <4E9BB180.6080506@mc.net> <4E9C0497.2000605@siriusit.co.uk> <4E9C3703.3040109@mc.net> <4E9C645A.5060200@twiddle.net> From: Blue Swirl Date: Mon, 17 Oct 2011 21:32:00 -0000 Message-ID: Subject: Re: [Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp To: Richard Henderson Cc: Bob Breuer , Mark Cave-Ayland , Kai Tietz , qemu-devel , "gcc@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/msg00257.txt.bz2 On Mon, Oct 17, 2011 at 5:22 PM, Richard Henderson wrote: > On 10/17/2011 07:09 AM, Bob Breuer wrote: >> I don't think this is a free/g_free issue. =C2=A0If I use the following >> patch, then I at least get the openbios messages: >> >> diff --git a/cpu-exec.c b/cpu-exec.c >> index a9fa608..dfbd6ea 100644 >> --- a/cpu-exec.c >> +++ b/cpu-exec.c >> @@ -180,6 +180,7 @@ static void cpu_handle_debug_exception(CPUState >> =C2=A0/* main execution loop */ >> >> =C2=A0volatile sig_atomic_t exit_request; >> +register void *ebp asm("ebp"); >> >> =C2=A0int cpu_exec(CPUState *env) >> =C2=A0{ >> @@ -233,6 +234,8 @@ int cpu_exec(CPUState *env) >> >> =C2=A0 =C2=A0 =C2=A0/* prepare setjmp context for exception handling */ >> =C2=A0 =C2=A0 =C2=A0for(;;) { >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0int dummy =3D 0; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0ebp =3D &dummy; > > See if > > =C2=A0asm("" : : : "ebp"); > > also solves the problem. > >> Google finds a mention of longjmp failing with -fomit-frame-pointer: >> http://lua-users.org/lists/lua-l/2005-02/msg00158.html >> >> Looks like gcc 4.6 turns on -fomit-frame-pointer by default. > > Hmm. =C2=A0This is the first I've heard of a longjmp implementation > failing without a frame pointer. =C2=A0Presumably this is with the > mingw i.e. msvc libc? > > This is something that could be worked around in gcc, I suppose. > We recognize longjmp for some things, we could force the use of > a frame pointer for msvc targets too. > > For now it might be best to simply force -fno-omit-frame-pointer > for mingw host in the configure script. IIRC buggy versions of alloca() could also fail without a frame pointer.