On Mon, 23 Jun 2014, Andi Kleen wrote:
I would prefer to not do it.
For the sake of micro benchmarks?
I'm not sure it has a lot of benefit.
It has a non-zero benefit.
If you want to keep it please make sure there is an easy way to turn
it off.
Any of these flags works:
-fdisable-tree-strlen
-fno-builtin-malloc
-fno-builtin-memset (assuming you wrote 'memset' explicitly in your code)
-fno-builtin
-ffreestanding
-O1
-Os
In the code, you can hide that the pointer passed to memset is the one
returned by malloc by storing it in a volatile variable, or any other
trick to hide from the compiler that we are doing memset(malloc(n),0,n).
--
Marc Glisse