I'd been having trouble with the courier-0.40.1 ebuild where, among other things, maildrop would exit with strange errorcodes even though there was no real error, screwing up the whole mail delivery process. I finally found a place on the maildrop mailing lists where it was suggested that these false errors were caused by compiler optimizations, specifically mentioning -fomit-frame-pointer. After I rebuilt with only CFLAGS="-march=k6-2 -O3 -pipe" CXXFLAGS="${CFLAGS}", taking off the -fomit-frame-pointer, everything is working fine. I suggest that the ebuild needs to guard against this flag if possible. If you need references to the specific posts on the mailing list I'll go track them down...
I have added the flag filter to courier-0.40.1 Compiler optimization causes more trouble in more places.