[Bug c++/110295] [11 Regression] ICE in dwarf2out_finish with local class with inherited operator delete in a templated function and -g

2023-12-15 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110295

Richard Biener  changed:

   What|Removed |Added

  Known to fail||11.4.0
 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to work||11.4.1

--- Comment #10 from Richard Biener  ---
Fixed.

[Bug c++/110295] [11 Regression] ICE in dwarf2out_finish with local class with inherited operator delete in a templated function and -g

2023-12-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110295

--- Comment #9 from GCC Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:01f088741bec84f8fa86f87fdb73db07d5febb0a

commit r11-11140-g01f088741bec84f8fa86f87fdb73db07d5febb0a
Author: Richard Biener 
Date:   Mon Jun 19 09:23:16 2023 +0200

debug/110295 - mixed up early/late debug for member DIEs

When we process a scope typedef during early debug creation and
we have already created a DIE for the type when the decl is
TYPE_DECL_IS_STUB and this DIE is still in limbo we end up
just re-parenting that type DIE instead of properly creating
a DIE for the decl, eventually picking up the now completed
type and creating DIEs for the members.  Instead this is currently
defered to the second time we come here, when we annotate the
DIEs with locations late where now the type DIE is no longer
in limbo and we fall through doing the job for the decl.

The following makes sure we perform the necessary early tasks
for this by continuing with the decl DIE creation after setting
a parent for the limbo type DIE.

PR debug/110295
* dwarf2out.c (process_scope_var): Continue processing
the decl after setting a parent in case the existing DIE
was in limbo.

* g++.dg/debug/pr110295.C: New testcase.

(cherry picked from commit 963f87f8a65ec82f503ac4334a3da83b0a8a43b2)