3 ms·
From comments: > avoiding [...] errno Note that errno can be optimized by a sufficiently smart compiler, simply by treating it as a register, then annotating
by o11c 3y ago
From comments:
> avoiding [...] errno
Note that errno can be optimized by a sufficiently smart compiler, simply by treating it as a register, then annotating various functions with whether it is preserved, clobbered, or conditionally used for return.
The libc boundary is quite annoying though; for this case in particular, that it doesn't expose the fact that errno is at a fixed offset from the TLS register. And generally, libc is vehemently opposed to the existence of smart compilers, since all libc calls are expected to be treated as opaque barriers.
- IAmLiterallyAB 3y ago> And generally, libc is vehemently opposed to the existence of smart compilers Yes, as far as I'm aware none of the major libcs on Linux support LTO
- gpderetta 3y agowell, yes, but you need whole-program compilation.
- deleted 3y ago[deleted]