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]

Re: EH, x86, optimizations and memory leaks


Quoting Manush Dodunekov (manush@litecom.se):
> 
> 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.
On my 686-pc-linux-gnulibc1 system, it even segfaults after a while
(first it consumes 2-3MB of RAM).

> Last time tried with egcs 1.1.1 prerelease 3, but older versions
> behaved the same way.
I tried with 1.1.1pre3 and egcs-2.92.23 (snapshot 19981122).

Bye,
Martin.

-- 
Your mouse has moved. Windows must be restarted for the change
to take effect. Reboot now?


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