Optimization bug
Martin Kahlert
martin.kahlert@keksy.mchp.siemens.de
Fri Oct 1 00:00:00 GMT 1999
[Posted and mailed]
In article < 7phuht$j2b$1@nnrp1.deja.com >,
Kurtz <seth_goldman@my-deja.com> writes:
> I have been having a problem with egcs 2.95 using optimization. My code
> runs fine without optimization, but as soon as you do -O, -O2, or -03
> the program will seg fault very quickly (always in the same place, too,
> and inside of code for malloc!). I have been over my code numerous
> times and cannot find any bugs in it. I have even run purify (since it
> was crashing in malloc) but to no avail. Is it possible that egcs is
> actually optimizing the code in such a way as to cause a segmentation
> fault? I have heard some not so good things about the optimization in
> egcs, so I thought I'd try to verify it. If anyone else has had similar
> problems, plz let me kno, since I'd like to believe it's egcs and not
> me. Thanks.
Perhaps it's a compiler bug, then try to extract a small testcase
and post it to egcs-bugs@egcs.cygnus.com. But all of my problems
with segfaults inside malloc came from a buggy program (using freed
memory or double free memory or something like that.
Perhaps it helps: Try Electric Fence. But without source, it's very
difficult to tell you where your problem is.
If you have another compiler handy, try that one, too.
Martin.
--
esa$ gcc -Wall -o ariane5 ariane5.c
ariane5.c: 666: warning: long float implicitly truncated to unsigned type
esa$ ariane5
More information about the Gcc-help
mailing list