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]
Other format: [Raw text]

Re: Adding debug symbols causes segmentation faults with GCC-4.1 and MIPS...


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.


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