Without any stdout/stderr output (literal copies, no "it crashed" summaries) it's impossible to tell the reason of the crash. It might be related to optimisations, but it might also be pure coincidence...
There are some rare cases where optimisations produce incorrect code. I had such a case recently with another application (ReZound): GCC 3.3 produced correct code with and without -O2, but GCC 4.0 produced correct one without and incorrect one with -O2.
In most cases these are GCC bugs. If you can, isolate them into the smallest possible code snippet which shows the problem and attach it to a bug report at
http://gcc.gnu.org/bugs.htmlPlease note that reports such as this one are not OK there; you will have to give at least the exact GCC version number and more background information.