We all typically have CFLAGS defined in /etc/make.conf; mine has -O2 ... I noticed during the 5.0.13 emerge process that the ebuild [or perhaps underlying build itself) that these CFLAGS are included with the CFLAGS defined for mysql. What I'm seeing during the build is: -O3 -DDBUG_OFF -O2 -march=pentium3 -pipe -mcpu=i686 -fomit-frame-pointer Obviously either the ebuild needs to strip user defined CFLAGS or the mysql build system should be patched to remove the -O3. Either way I'm not sure what effect the combo of -O3 and -O2 have on the build itself (which one would take priority based on order, etc.)
in your example "-O2" , the latest, is used. Saying the truth MySQL suggest (and do it's tests) using "-O3". I was tempted to strip user flags but not feel secure enough of the results, so we are stick wit current behaviour. Strip MySQL provided optimization require modyfing autotools files, these one change often and imho it's not a very good idea change them for what at the end look as a cosmetic change.
closing