4 ms·
I believe the main culprit is that the compiler guys want to optimize away Cpp templates, where programmer intent is not as explicit as in C.
by rightbyte 4y ago
I believe the main culprit is that the compiler guys want to optimize away Cpp templates, where programmer intent is not as explicit as in C.
- pjmlp 4y agoC has enough UB of its own, no need to bring C++ into the picture.
- rightbyte 4y agoI meant that the shared compiler code with Cpp is the problem. At least in gcc. I don't know about Clang.
- JonChesterfield 4y agoI attribute it to benchmarks. Spec and the like. Where you can indeed make the benchmarks faster by leaning into UB. No signed overflow? Branch gone from that loop. Prove these two things can't alias because the pointer provenance model says they don't and you can rearrange the loads and stores. The collateral damage from that line of work is high though.
- rightbyte 4y agoYe you might be correct. I think they are overreaching a bit in the eagerness to optimize.