|
|
|
|
|
by Dylan16807
34 days ago
|
|
But "without losing performance" and "without having bugs" are completely different criteria. I get the original point, and I'm not saying the compilers are justified in all their aggressive optimizations, but I don't think the quote you gave is talking about the same thing. There are things you simply can't write in C. I think that's okay. But even if you don't think that's okay, it doesn't conflict with zero-overhead. - But also, when it comes to jumping by address to a goto you didn't check is at that address, I'm on the side of the compiler here. That's not how computed goto is supposed to work. You're supposed to use an address you can know is right by reading the code. |
|
It's like checking for overflow in an arithmetic operation. Other languages do the checking, and that's why they're slower. But C++ doesn't check because it offloads the responsibility to the coder, so the coder can write faster code if he makes sure there are no bugs.
If the coder knows there will be four return values and writes them one after the other, the return (or MOV) instructions are distanced the same. The goto hack should work.