It drives me nuts when I compile code with "-ggdb -gdwarf-4 -O0" and gdb still reports some symbols as "optimized away". I hope the bullet point above refers to this.
(Ninja edit: although tuning for GDB might coax LLVM to emit the pre-standardised form, without DWARF-5).
1) build with "-O0 -ggdb"
2) In a debug session, notice that a variable I want to inspect has supposedly been optimized away. Get extremely frustrated.
3) Rebuild with every debug-friendly flag I can conceive of "-O0 -ggdb -fno-inline -gdwarf-4 -fno-omit-frame-pointer ..."
4) IIRC, step 3 usually (but not always?) addresses the issue.
But long story short, I don't think I've ever pinned down the minimal requirements for avoiding the issue. Usually when I encounter this, I have bigger issues to deal with.
[1]: https://clang.llvm.org/docs/UsersManual.html#controlling-deb...
* The debug information now has a feature which lets your debugger recover the value of an optimized-out value in certain (common) circumstances. I wish gdb and lldb pick on up this quickly and that it doesn't need you to specify anything explicitly.
* If you're doing JITing with LLVM, you can now run your code's static initializations (which apparently you couldn't before? :-O )
* Lots of RISC-V-related work (features, optimization improvements and bug fixes).
* Nothing new for PTX (the CUDA IR which you can use LLVM to generate).