|
From: Julian S. <js...@ac...> - 2004-08-24 12:31:37
|
> Is there any particular reason why Memcheck is built at -O2, but all the > other tools are built at -O? Is -O / -O2 the only distinction, or is it -O vs -O2 -fomit-frame-pointer? I seem to remember trying to max out performance for the helper routines for memcheck (obviously) and hence have -O2 -fomit-frame-pointer -malign-somthing-or-other=4 iirc. The last flag says that a 4-byte aligned stack is OK and stopped some clueless versions of gcc from adding/subtracting constants from the stack pointer to get it aligned, which turned out to be a significant time waster for the memcheck memory access helpers. Such alignment is particularly useless given that in those helpers gcc never generates any %esp-relative accesses anyway. Duh. I don't have a problem with -O2 per se, but my general feel over N years of hacking is that it doesn't give much performance improvment over -O and exposes one to more gcc bugs, and makes compilation takes longer, hence it wasn't worth it. That's just religion, though, so I'd say -O2ifiy it if you like. -fomit-frame-pointer generally makes debugging difficult, so that is probably not a good thing to plumb everywhere. In fact there are some places (where we want to get stack snapshots of, eg vg_libpthread.c) which positively have to say -fno-omit-frame-pointer, I believe. J |