https://bugzilla.suse.com/show_bug.cgi?id=1216000 https://bugzilla.suse.com/show_bug.cgi?id=1216000#c1 --- Comment #1 from Richard Biener <rguenther@suse.com> --- Both -Og and even more so -O1 can end up eliminating variables and thus make debugging harder. -Og is "optimize but watch out for debugging", that's of course more difficult to debug than -O0 "do not optimize". So it works like designed - whether in your case I can't tell because you didn't provide a testcase. Note that the result of some_function_of_mine is in %rax only, if that's not preserved somewhere else and the register is clobbered (it doesn't have to be preserved across calls) then this is the answer why it doesn't work when optimizing. When not optimizing 'result' is placed on the stack. -- You are receiving this mail because: You are on the CC list for the bug.