[Bug d/89017] ICE in force_type_die, at dwarf2out.c:26061

ibuclaw at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 20 23:53:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89017

--- Comment #2 from ibuclaw at gcc dot gnu.org ---
Author: ibuclaw
Date: Wed Mar 20 23:52:48 2019
New Revision: 269828

URL: https://gcc.gnu.org/viewcvs?rev=269828&root=gcc&view=rev
Log:
d: Fix ICE force_type_die, at dwarf2out.c using nested types

In functions whose return type is instantiated from a nested template,
make sure that all members of the instance are emitted before finishing
the outer function, otherwise they will be removed during the
prune_unused_types pass.

gcc/d/ChangeLog:

2019-03-21  Iain Buclaw  <ibuclaw@gdcproject.org>

        PR d/89017
        * d-codegen.cc (d_decl_context): Skip over template instances when
        finding the context.
        * decl.cc (DeclVisitor::visit(TemplateDeclaration)): New override.
        (build_type_decl): Include parameters in name of template types.

gcc/testsuite/ChangeLog:

2019-03-21  Iain Buclaw  <ibuclaw@gdcproject.org>

        PR d/89017
        * gdc.dg/pr89017.d: New test.

Added:
    trunk/gcc/testsuite/gdc.dg/pr89017.d
Modified:
    trunk/gcc/d/ChangeLog
    trunk/gcc/d/d-codegen.cc
    trunk/gcc/d/decl.cc
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list