]> git.ipfire.org Git - thirdparty/gcc.git/commit
debug/110295 - mixed up early/late debug for member DIEs
authorRichard Biener <rguenther@suse.de>
Mon, 19 Jun 2023 07:23:16 +0000 (09:23 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 20 Jun 2023 06:59:20 +0000 (08:59 +0200)
commit963f87f8a65ec82f503ac4334a3da83b0a8a43b2
tree8a9ab1024e9db89347a36de19bef07e355dea01c
parent62514099cb56574d96e29e2688aca23eeba5268f
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.cc (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.
gcc/dwarf2out.cc
gcc/testsuite/g++.dg/debug/pr110295.C [new file with mode: 0644]