Re: -O2 vs -O3

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Thu May 25 2000 - 06:46:30 EST


Dave Jones wrote:
> During the early development of Powertweak I set the Makefile files to compile
> some routines with -O3 instead of -O2. I then spent hours looking for a bug
> which wasn't there. The optimiser was over-zealous, and removed a pointer
> assignment.

-O3 turns on extra inlining. Inlining can allow the optimisers to do
fuller alias analysis. Type alias analysis breaks things which recast
pointer types such as malloc, memcpy, graphics rendering loops, etc.
(But usually only when they're inlined).

Did you have -fstrict-aliasing turned on (possible by default as it was
with some EGCS & GCC versions)?

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:14 EST