From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1187 invoked by alias); 24 Nov 2004 08:12:52 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 986 invoked from network); 24 Nov 2004 08:12:29 -0000 Received: from unknown (HELO smtp1.clear.net.nz) (203.97.33.27) by sourceware.org with SMTP; 24 Nov 2004 08:12:29 -0000 Received: from DANNY (t001-m001-u140.acld.clear.net.nz [203.97.72.140]) by smtp1.clear.net.nz (CLEAR Net Mail) with SMTP id <0I7O00JX1C4QSN@smtp1.clear.net.nz> for gcc@gcc.gnu.org; Wed, 24 Nov 2004 21:12:28 +1300 (NZDT) Date: Wed, 24 Nov 2004 08:40:00 -0000 From: Danny Smith Subject: Re: stdcall lib functions with exception throwing callbacks vs Dwarf2 EH To: Richard Henderson Cc: gcc@gcc.gnu.org, Cygwin , mingw-dvlpr Reply-to: Danny Smith Message-id: <000401c4d1fd$112d9eb0$8c4861cb@DANNY> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit References: <001701c4d1ab$949322e0$0a6d65da@DANNY> <20041124003240.GA6028@redhat.com> X-SW-Source: 2004-11/txt/msg00884.txt.bz2 Richard Henderson wrote: > On Wed, Nov 24, 2004 at 11:27:11AM +1300, Danny Smith wrote: >> Before I pull any more hair out trying, does any one have any hints >> on how to use an MD_FALLBACK_FRAME_STATE_FOR to workaround ... > > That would be wrong. > > I think the most likely explanation is that there's a bug in the > dwarf2 generator for stdcall functions with -fomit-frame-pointer, > and the problem should be attacked there. > There does seem to be a problem in the frame-pointer handling see: http://gcc.gnu.org/ml/gcc/2002-11/msg00149.html With this testcase: void __attribute__((stdcall)) test( int a) { a; } void snafu( void) { test( 666); throw 999; } int main( void) { try { snafu( ); return 0; } catch( ...) { return 1; } } I get (today): g++ -fno-omit-frame-pointer PASS (at all optimisation levels). g++ -O{0|1|2} -fomit-frame-pointer -maccumulate-outgoing-args PASS. g++ -O0 -mtune=i686 -mno-accumulate-outgoing-args -fomit-frame-pointer FAIL g++ -O{1,2} -mtune=i686 -mno-accumulate-outgoing-args -fomit-frame-poi nter PASS The optimisation flags that cause failure has changed since the original gcc report. Danny