From 11fd6567700b18509690419640c406fa7321639e Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sun, 12 Jan 2014 15:46:54 +0000 Subject: [PATCH] Bug #92 - ICE in runnable/testenum.d with -g --- gcc/d/ChangeLog | 5 +++++ gcc/d/d-decls.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index e0e4c5315..15a275928 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,8 @@ +2014-01-12 Iain Buclaw + + * d-decls.cc(EnumDeclaration::toDebug): Build TYPE_DECL only for + enumeral types. + 2014-01-06 Iain Buclaw * d-ctype.cc(TypeClass::toCtype): Don't add __monitor field for diff --git a/gcc/d/d-decls.cc b/gcc/d/d-decls.cc index 57f91f313..b60e6999a 100644 --- a/gcc/d/d-decls.cc +++ b/gcc/d/d-decls.cc @@ -795,7 +795,9 @@ EnumDeclaration::toDebug (void) return; tree ctype = type->toCtype(); - build_type_decl (ctype, this); + + if (TREE_CODE (ctype) == ENUMERAL_TYPE) + build_type_decl (ctype, this); // The ctype is not necessarily enum, which doesn't sit well with // rest_of_type_compilation. Can call this on structs though.