https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112708
--- Comment #8 from Bruno Haible <bruno at clisp dot org> --- (In reply to Richard Biener from comment #7) > It's -fvar-tracking, not -fvar-tracking-assignments. At -O0 debug info > during the prologue is unreliable without that. Then how about enabling -fvar-tracking automatically when "-g" or "-ggdb" is requested and the debug format supports it? The documentation https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Debugging-Options.html says: "It is enabled by default when compiling with optimization (-Os, -O, -O2, …), debugging information (-g) and the debug info format supports it." Why not also enable it when compiling _without_ optimization? I'm not using "-Og" because the documentation https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Optimize-Options.html says "-Og enables all -O1 optimization flags except for those that may interfere with debugging", but what I want is optimal debugging and don't want to spend CPU cycles on optimization.