[Bug debug/78685] -Og generates too many "<optimized out>"s (it should generate artificial uses for variables at end of scope to avoid this)

matthias at urlichs dot de gcc-bugzilla@gcc.gnu.org
Thu Mar 12 10:25:06 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78685

--- Comment #43 from Matthias Urlichs <matthias at urlichs dot de> ---
On 12.03.26 09:51, rguenther at suse dot de wrote:
> But making all variables
> live until end of scope defeats the goal of having optimized code.

True; however, maybe we can spend some effort on adapting the 
optimization rules here. My pet peeve here is that debuggable optimized 
code should free no-longer-used variables at the start of the next 
statement, instead of at the end of the current one.

That way, I can set a conditional breakpoint on the result of a function 
call (i.e. on the next line) and would still be able to examine the 
call's arguments.


More information about the Gcc-bugs mailing list