logoalt Hacker News

leni536yesterday at 6:33 PM2 repliesview on HN

A call to a standard library function is still subject to the as if rule. It doesn't have to manifest into a call instruction to a standard library function. Much like memcpy in source code doesn't have to manifest to a call instruction.


Replies

ack_completetoday at 1:57 AM

Yes, but the compiler does have to preserve any observable behavior produced by the call to the standard library function. Being able to omit this inserted yield() by the as if rule would mean that it isn't observable, which would also mean that the compiler could already add or not add it anywhere as needed without changing the behavior of the program. Which would seemingly make the inserted yield() pointless as it would have no effect.

show 1 reply
fc417fc802yesterday at 9:54 PM

Me: I don't expect to be stabbed.

You: But you only might be stabbed. It isn't required to happen only permitted.