Compiling doxygen with GCC 4 and -O3 causes doxygen to behave improperly. Could
verify it myself with app-doc/doxygen-1.4.[347], gcc-4.1.1 and
CFLAGS="-march=athlon-xp -O3 -mfpmath=sse -msse". Setting optimization level
down to -O2 made the problem disappear, so it might be a problem with GCC.
Still the ebuild might want to check for affected versions of gcc and perform
some actions to avoid the problem, or whatever is more suitable.
Yes, -O3 still produces incorrect optimizations. In general, it's best not to
try to over-optimze code with gcc; not just because -O3 is buggy, but also
because in the majority of cases, gcc is way smarter about it. It will
automatically enable the stuff that works, including mmx, sse, etc, when it
can. Forcing things OTOH, breaks packages more often than not. I would just
use -O2, along with a few other safe things, and not worry about it...