the most damaging line of thought is "the compiler is smarter than you, ppl who made std::* are smarter than you, don't reinvent the wheel" -- yeah, if you started programming yesterday that's probably true, but once you apply yourself, all those things fall to the ground
-
-
Then how would you compile code that you think can't be optimized no more? -O0 with a few select flags at best. -O1 (at least on gcc) already implies things like -freorder-blocks, which is letting the compiler make decisions for you.
-
- Show replies
New conversation -
-
-
It will load and store from the stack when you're using variable that live on the stack - just as you wrote it. Try the register keyword and you'll see those loads and stores disappear in -O0 - because now your code tells it to not use the stack.
-
This is one of the basic optimizations that the compiler does for you by not taking your code verbatim, but by deciding on its own what storage class is appropriate.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.