Hacker News new | ask | show | jobs
by foodevl 4368 days ago
The 250% more instructions are the frame pointer, which is how your debugger figures out the stack trace when you happen to break execution at the "xor eax, eax". Use -fomit-frame-pointer to get rid of that. That has nothing to do with optimization.
1 comments

Those extra instructions shouldn't be necessary even when debugging, since that's what the -g option is for; to generate information the debugger can use: http://yosefk.com/blog/getting-the-call-stack-without-a-fram...

When optimisation is enabled, all extraneous instructions should disappear.