This is the mail archive of the gcc@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]

EH, x86, optimizations and memory leaks



The following code:

struct Test {};

int main(void)
{
	while(true) {
		try {
			throw Test();
		} catch(Test& t) {
		}
	}
	return 0;
}

works as it should (just eats cpu until it's killed) when compiled with no
optimizations.

However, when compiled with -O1 or higher, the same code keeps eating
memory until the computer swaps itself to death.

egcs is configured with --enable-threads on an i686-pc-linux-gnu 
(redhat 5.2 with glibc 2.0.7)

Last time tried with egcs 1.1.1 prerelease 3, but older versions
behaved the same way.

Any ideas on what I can do to avoid this? Or should I just forget about
mixing EH and optimizations?


------------------------------------------
  Manush Dodunekov / LiteCom Interactive
 manush@litecom.se, http://www.litecom.se
------------------------------------------



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