This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

exceptions handling and memory leak in egcs1.1


Hi,

I think I discovered a bug in the egcs 1.1 exeception
code.

Here's a little test program to exhibit this bug.

-------------------

#include <stdio.h>

void *mt (void *arg)
{
long i;
  for( i=0; i<100000; i++ )
  {
     try {
        throw( 5 );
     } catch (int x)
       {}
  }
  return (void*)i;
}

void main (int argc, char *argv[])
{
  printf( "result: %d\n", (int)mt(0) );
}

---------------------------

Everything is fine, as long as no optimizations are used.
As soon as some optimizations are user (-O, -O2, -O3) 
the process will leak memory until it segfaults.

Cheers,

	Lars



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]