3 ms·
Thanks for the clarification (also to archgoon). To your last point, I should have used -O1 instead of -O2, this also makes it clear what happens on the callsit
by flohofwoe 6y ago
Thanks for the clarification (also to archgoon). To your last point, I should have used -O1 instead of -O2, this also makes it clear what happens on the callsite.
- nikki93 6y agoAnother approach is to use a `volatile` function pointer: https://www.godbolt.org/z/e6GM93 https://www.godbolt.org/z/e6GM93 -- That way you get to keep other optimizations from `-O3` without inlining the function call itself.
- ddalcino 6y agoYou don’t need to lower the optimization level to see what happens at the call site: you can turn the function ‘blub’ into a function prototype. The optimizer cannot in-line your code if it isn’t available. https://www.godbolt.org/z/sj11rc https://www.godbolt.org/z/sj11rc