3 ms·
https://godbolt.org/z/z-92qR https://godbolt.org/z/z-92qR Interestingly, the compiler emits no call to malloc, even. What!?
by jepler 6y ago
https://godbolt.org/z/z-92qR https://godbolt.org/z/z-92qR
Interestingly, the compiler emits no call to malloc, even. What!?
- gpderetta 6y agoThe compiler knows the semantics of malloc. Malloc as it appear in the source code doesn't even need to map 1:1 to calls to the library function, the compiler can remove and coalesce calls at will.
- steerablesafe 6y agoWith -fno-builtin. It's still "cheating" as b is local. https://godbolt.org/z/U5VGxt https://godbolt.org/z/U5VGxt Without cheating: https://godbolt.org/z/rzcXg2 https://godbolt.org/z/rzcXg2 It doesn't optimize the two stores to b away.