[gccsdk] Bug in exception handling in GCC4

alan buckley alan_baa at hotmail.com
Mon Nov 23 05:21:27 PST 2009

I've managed to reduce the code sample I posted
a while ago about a crash in the GCC4 compiler
to a lot fewer lines.
The below program will crash rather than
successfully catch the thrown exception.
The line that seems to cause the error is
char buffer[size];
If I comment out the line it works correctly.

#include <iostream>
void throw_test()
 std::cout << "in throw test" << std::endl;
 unsigned int size = 2;
 throw 1;
 char buffer[size];
int main(int argc, char *argv[])
 } catch(int err)
  std::cout << "Got thrown int as expected\n" << std::endl;

Is there anyone who can have a look at this for me?
I got no response from the previous example, but hopefully
I've reduced the example to be small enough so someone
can have a quick look at it.
Add your Gmail and Yahoo! Mail email accounts into Hotmail - it's easy

More information about the gcc mailing list