From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16929 invoked by alias); 7 Nov 2002 17:54:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16908 invoked from network); 7 Nov 2002 17:54:31 -0000 Received: from unknown (HELO mx2.redhat.com) (12.150.115.133) by sources.redhat.com with SMTP; 7 Nov 2002 17:54:31 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.11.6/8.11.6) with ESMTP id gA7HquP11809; Thu, 7 Nov 2002 12:52:56 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gA7HsUl21773; Thu, 7 Nov 2002 12:54:30 -0500 Received: from localhost.localdomain (frothingslosh.sfbay.redhat.com [172.16.24.27]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id gA7HsTD22035; Thu, 7 Nov 2002 09:54:29 -0800 Received: (from rth@localhost) by localhost.localdomain (8.11.6/8.11.6) id gA7HsTt26011; Thu, 7 Nov 2002 09:54:29 -0800 X-Authentication-Warning: localhost.localdomain: rth set sender to rth@redhat.com using -f Date: Thu, 07 Nov 2002 09:54:00 -0000 From: Richard Henderson To: Fergus Henderson Cc: Aldy Hernandez , "Joseph S. Myers" , gcc-patches@gcc.gnu.org, jakub@redhat.com, jason@redhat.com Subject: Re: [basic-improvements] try/finally support for c/c++ Message-ID: <20021107175429.GA26004@redhat.com> Mail-Followup-To: Richard Henderson , Fergus Henderson , Aldy Hernandez , "Joseph S. Myers" , gcc-patches@gcc.gnu.org, jakub@redhat.com, jason@redhat.com References: <20021106070622.GA31658@redhat.com> <20021106183215.GE7736@redhat.com> <20021106185333.GF22066@redhat.com> <20021107014507.GB4193@ceres.cs.mu.oz.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021107014507.GB4193@ceres.cs.mu.oz.au> User-Agent: Mutt/1.4i X-SW-Source: 2002-11/txt/msg00476.txt.bz2 On Thu, Nov 07, 2002 at 12:45:08PM +1100, Fergus Henderson wrote: > (3) programmers must take great care when using longjmp() > or try/finally to ensure that the two are not used together in > a way that will result in undefined behaviour. This requires > global (or at least non-local) analysis of the program. > The analysis must be redone whenever any code is added which > uses try/finally or longjmp, or even just when code which > might use those constructs is rearranged. Furthermore, > there are no tools which will help in this analysis, no > support for run-time checking of this property, and bugs > caused in this way may only show up on some platforms, > so on some platforms testing will never detect the bug. > OUCH! 3, really. Though ideally we'd have the function longjmp_unwind, which is mentioned in the IA-64 psABI as a function that runs cleanups along the path to the setjmp target. > Another issue is using goto to jump out of nested functions. > This has similar properties to longjmp or throwing exceptions, > i.e. it unwinds the stack. The relationship between that and > __try/__finally needs to be documented. Same problem, though I'm happy to deprecate it. r~