News for hackers. Stuff that matters.
Re:C Is Not a Low-Level Language by kazinator on Tuesday May 01, 2018 @12:36PM (#16968631)
> Register renaming, cache hierarchies, out of order and speculative execution etc are not visible

That's different from C.

In the history of x86, most new optimizations have preserved the semantics of code. For instance, register renaming isn't blind; it identifies and resolves hazards.

In C, increasing optimization has broken existing programs.

C is like a really shitty machine architecture that doesn't detect errors. For instance, overflow doesn't wrap around and set a nice flag, or throw an exception; it's just "undefined". It's easy to make a program which appears to work, but is relying on behavior outside of the documentation, which will change.

Computer architectures were crappy like that in the beginning. The mainframe vendors smartened up because they couldn't sell a more expensive, faster machine to a customer if the customer's code relied on undocumented behaviors that no longer work on the new machine.

Then, early microprocessors in the 1970's and 80's repeated the pattern: poor exception handling and undocumented opcodes that did curious things (no "illegal instruction" trap).

Re:C Is Not a Low-Level Language by gpderetta on Tuesday May 01, 2018 @05:48PM (#16972037)
Then again store-load reordering is visible across cores and undefined.