Re: try/finally in GNU C

2006-06-16 Thread Mike Stump
On Jun 16, 2006, at 12:47 AM, Paolo Bonzini wrote: I think that every variable you do "weird" things with in C, must be declared volatile. The C++/Objective-C/Objective-C++ language standards ensures that you don't have to mark all variables volatile in the presence of EH. These builtins

Re: try/finally in GNU C

2006-06-16 Thread Mike Stump
On Jun 16, 2006, at 5:54 AM, Gabriel Dos Reis wrote: For the bootstrapping problem I mentioned earlier, they added volatile to variables in the scope but it did not change anything. For the problem I am thinking of, volatile should go a long way in working around the compiler bug, assuming no

Re: try/finally in GNU C

2006-06-16 Thread Jonathan Wilson
> The discussion kind of wandered off, but I'd like to note that I am in > favor of adding __try/__finally as a GNU extension for both C and C++. > It's true, of course, that it's just syntactic sugar which can be > implemented in other ways, but sometimes sugar is sweet. How would this mesh with

Re: try/finally in GNU C

2006-06-16 Thread Gabriel Dos Reis
"Steven Bosscher" <[EMAIL PROTECTED]> writes: | On 6/16/06, Mike Stump <[EMAIL PROTECTED]> wrote: | > foo() { | >int i = 99; | >__builtin_setjmp(A) | >if (i) { | > print i | > --i; | > __builtin_longjump(A); | >} | > | > It used to not infinite loop, now it does. | >

Re: try/finally in GNU C

2006-06-16 Thread Paolo Bonzini
Steven Bosscher wrote: On 6/16/06, Mike Stump <[EMAIL PROTECTED]> wrote: > foo() { >int i = 99; >__builtin_setjmp(A) >if (i) { > print i > --i; > __builtin_longjump(A); >} > > It used to not infinite loop, now it does. We had an example just like this on IRC only a

Re: try/finally in GNU C

2006-06-16 Thread Ian Lance Taylor
Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > while looking into a recent mismatch between GCC-4.x and a C dialect > EH implemented as setjmp/longjmp, I recalled there was a talk about > extending GNU C with __try/__finally construct: > > http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00239.

Re: try/finally in GNU C

2006-06-15 Thread Steven Bosscher
On 6/16/06, Mike Stump <[EMAIL PROTECTED]> wrote: foo() { int i = 99; __builtin_setjmp(A) if (i) { print i --i; __builtin_longjump(A); } It used to not infinite loop, now it does. We had an example just like this on IRC only a few weeks ago. ISTR it was decided that

Re: try/finally in GNU C

2006-06-15 Thread Mike Stump
On Jun 15, 2006, at 4:47 PM, Andrew Pinski wrote: The front-end in question has stopped working because the traditional setjmp/longjmp translation of try/catch constructs is no longer working correctly with versions of GCC higher than 4.0. How is it no longer working? I don't understand how i

Re: try/finally in GNU C

2006-06-15 Thread Gabriel Dos Reis
On Thu, 15 Jun 2006, Andrew Pinski wrote: | > | > Andrew Pinski <[EMAIL PROTECTED]> writes: | > | > | > while looking into a recent mismatch between GCC-4.x and a C dialect | > | > EH implemented as setjmp/longjmp, I recalled there was a talk about | > | > extending GNU C with __try/__finally co

Re: try/finally in GNU C

2006-06-15 Thread Andrew Pinski
> > Andrew Pinski <[EMAIL PROTECTED]> writes: > > | > while looking into a recent mismatch between GCC-4.x and a C dialect > | > EH implemented as setjmp/longjmp, I recalled there was a talk about > | > extending GNU C with __try/__finally construct: > | > > | > http://gcc.gnu.org/ml/gcc-p

Re: try/finally in GNU C

2006-06-15 Thread Gabriel Dos Reis
On Thu, 15 Jun 2006, Andrew Pinski wrote: | > | > On Thu, Jun 15, 2006 at 07:21:03PM -0400, Andrew Pinski wrote: | > > > while looking into a recent mismatch between GCC-4.x and a C dialect | > > > EH implemented as setjmp/longjmp, I recalled there was a talk about | > > > extending GNU C with _

Re: try/finally in GNU C

2006-06-15 Thread Gabriel Dos Reis
Andrew Pinski <[EMAIL PROTECTED]> writes: | > while looking into a recent mismatch between GCC-4.x and a C dialect | > EH implemented as setjmp/longjmp, I recalled there was a talk about | > extending GNU C with __try/__finally construct: | > | > http://gcc.gnu.org/ml/gcc-patches/2002-11/ms

Re: try/finally in GNU C

2006-06-15 Thread Andrew Pinski
> > On Thu, Jun 15, 2006 at 07:21:03PM -0400, Andrew Pinski wrote: > > > while looking into a recent mismatch between GCC-4.x and a C dialect > > > EH implemented as setjmp/longjmp, I recalled there was a talk about > > > extending GNU C with __try/__finally construct: > > > > > > http://gc

Re: try/finally in GNU C

2006-06-15 Thread Joe Buck
On Thu, Jun 15, 2006 at 07:21:03PM -0400, Andrew Pinski wrote: > > while looking into a recent mismatch between GCC-4.x and a C dialect > > EH implemented as setjmp/longjmp, I recalled there was a talk about > > extending GNU C with __try/__finally construct: > > > > http://gcc.gnu.org/ml/gc

Re: try/finally in GNU C

2006-06-15 Thread Andrew Pinski
> while looking into a recent mismatch between GCC-4.x and a C dialect > EH implemented as setjmp/longjmp, I recalled there was a talk about > extending GNU C with __try/__finally construct: > > http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00239.html > > What happened to that project? Is i

try/finally in GNU C

2006-06-15 Thread Gabriel Dos Reis
Hi, while looking into a recent mismatch between GCC-4.x and a C dialect EH implemented as setjmp/longjmp, I recalled there was a talk about extending GNU C with __try/__finally construct: http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00239.html What happened to that project? Is it dead f