d: Fix ICE in dwarf2out_imported_module_or_decl, at dwarf2out.cc:27676 [PR119817]
The ImportVisitor method for handling the importing of overload sets was pushing NULL_TREE to the array of import decls, which in turn got passed to `debug_hooks->imported_module_or_decl', triggering the observed internal compiler error. NULL_TREE is returned from `build_import_decl' when the symbol was ignored for being non-trivial to represent in debug, for example, template or tuple declarations. So similarly "skip" adding the symbol when this is the case for overload sets too. PR d/119817 gcc/d/ChangeLog: * imports.cc (ImportVisitor::visit (OverloadSet *)): Don't push NULL_TREE to vector of import symbols. gcc/testsuite/ChangeLog: * gdc.dg/debug/imports/m119817/a.d: New test. * gdc.dg/debug/imports/m119817/b.d: New test. * gdc.dg/debug/imports/m119817/package.d: New test. * gdc.dg/debug/pr119817.d: New test.
This commit is contained in:
parent
bf115fd457
commit
f5ed7d19c9
5 changed files with 19 additions and 1 deletions
|
@ -182,7 +182,11 @@ public:
|
|||
vec_alloc (tset, d->a.length);
|
||||
|
||||
for (size_t i = 0; i < d->a.length; i++)
|
||||
vec_safe_push (tset, build_import_decl (d->a[i]));
|
||||
{
|
||||
tree overload = build_import_decl (d->a[i]);
|
||||
if (overload != NULL_TREE)
|
||||
vec_safe_push (tset, overload);
|
||||
}
|
||||
|
||||
this->result_ = build_tree_list_vec (tset);
|
||||
tset->truncate (0);
|
||||
|
|
2
gcc/testsuite/gdc.dg/debug/imports/m119817/a.d
Normal file
2
gcc/testsuite/gdc.dg/debug/imports/m119817/a.d
Normal file
|
@ -0,0 +1,2 @@
|
|||
module imports.m119817.a;
|
||||
void f119817()() { }
|
2
gcc/testsuite/gdc.dg/debug/imports/m119817/b.d
Normal file
2
gcc/testsuite/gdc.dg/debug/imports/m119817/b.d
Normal file
|
@ -0,0 +1,2 @@
|
|||
module imports.m119817.b;
|
||||
void f119817() { }
|
4
gcc/testsuite/gdc.dg/debug/imports/m119817/package.d
Normal file
4
gcc/testsuite/gdc.dg/debug/imports/m119817/package.d
Normal file
|
@ -0,0 +1,4 @@
|
|||
module imports.m119817;
|
||||
public import
|
||||
imports.m119817.a,
|
||||
imports.m119817.b;
|
6
gcc/testsuite/gdc.dg/debug/pr119817.d
Normal file
6
gcc/testsuite/gdc.dg/debug/pr119817.d
Normal file
|
@ -0,0 +1,6 @@
|
|||
// { dg-do compile }
|
||||
// { dg-additional-sources "imports/m119817/package.d" }
|
||||
// { dg-additional-sources "imports/m119817/a.d" }
|
||||
// { dg-additional-sources "imports/m119817/b.d" }
|
||||
module pr119817;
|
||||
import imports.m119817 : f119817;
|
Loading…
Add table
Reference in a new issue