This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Adding debug symbols causes segmentation faults with GCC-4.1 and MIPS...
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: "Steven J. Hill" <sjhill at realitydiluted dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 12 Sep 2005 22:36:46 -0700
- Subject: Re: Adding debug symbols causes segmentation faults with GCC-4.1 and MIPS...
- References: <432636D5.8060005@realitydiluted.com>
On Mon, Sep 12, 2005 at 09:17:57PM -0500, Steven J. Hill wrote:
> I attempted to search through Bugzilla, but I did not find anything that
> matched my query. When using the options '-O0' and '-g' together with
> GCC-4.1.0,
> I get an executable that will segfault. If I use all the other
> optimizations of
> -O1, -O2 or -Os I do not have this problem.
While it is possible that the toolchain is at fault, it is also
possible that it is a program bug.
Sometimes memory corruption can look like this: if you have an
uninitialized pointer, trash the heap, etc. it can have different
effects depending on optimization level. Even the size of your
environment can have an effect.
You might want to first make sure that your program has no memory
access errors. You could try building it for x86 and debugging
with valgrind, to see if that catches anything.