Mail Archives: djgpp/1998/08/30/10:13:52
On Sat, 29 Aug 1998, Endlisnis wrote:
> > Actually it states that -O2 is the best optimizations switch without a
> > speed/size tradeoff.
> But, -O1,2 or 3 sometimes make programs that don't do what you might
> expect/desire. I have a few VERY LONG programs that do not do the same stuff
> when compiled with any optimizations on. They are fully ANSI compilent
> programs not trying to do anything tricky.
It is a bug when a program behaves differently under different
optimization switches. Usually, the bug is in the application code,
not in the compiler. Unless these programs explore the fine details
of machine arithmetics, which AFAIK is the only case when
optimizations should NOT be used, you need to debug those programs,
I'd say.
- Raw text -