https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124432
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:364174970369811c56b7491e37927b1ce3cda119 commit r17-6606-g364174970369811c56b7491e37927b1ce3cda119 Author: Oleg Tolmatcev <[email protected]> Date: Mon Nov 23 11:15:21 2026 -0700 [PATCH] codeview: Skip local variables without names [PR124432] Artificial local variables can have no DW_AT_name. Emitting their CodeView symbol records dereferences a null pointer. Skip unnamed locals in the unoptimized symbol writers and in write_optimized_local_variable. Skip optimized locals before emitting both S_LOCAL and its location ranges so no orphaned S_DEFRANGE records are emitted. PR debug/124432 gcc/ChangeLog: * dwarf2codeview.cc (write_local_s_ldata32): Skip unnamed variables. (write_s_register): Likewise. (write_fbreg_variable): Likewise. (write_optimized_local_variable): Likewise, including their location ranges. gcc/testsuite/ChangeLog: * g++.dg/debug/codeview/codeview.exp: New test driver. * g++.dg/debug/codeview/pr124432.C: New test. * g++.dg/debug/codeview/pr124432-2.C: Likewise. Signed-off-by: Oleg Tolmatcev <[email protected]>
