From 405f63da1c335254a9f4c27bde94d7be7340524c Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Wed, 22 Sep 1999 21:37:20 +0000 Subject: Fix complex-5.c problem From-SVN: r29604 --- gcc/dwarf2out.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a79339c..43d1eaa 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -6248,9 +6248,15 @@ base_type_die (type) || TREE_CODE (type) == VOID_TYPE) return 0; - if (TREE_CODE (name) == TYPE_DECL) - name = DECL_NAME (name); - type_name = IDENTIFIER_POINTER (name); + if (name) + { + if (TREE_CODE (name) == TYPE_DECL) + name = DECL_NAME (name); + + type_name = IDENTIFIER_POINTER (name); + } + else + type_name = "__unknown__"; switch (TREE_CODE (type)) { @@ -6284,8 +6290,13 @@ base_type_die (type) encoding = DW_ATE_float; break; + /* Dwarf2 doesn't know anything about complex ints, so use + a user defined type for it. */ case COMPLEX_TYPE: - encoding = DW_ATE_complex_float; + if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE) + encoding = DW_ATE_complex_float; + else + encoding = DW_ATE_lo_user; break; case BOOLEAN_TYPE: -- cgit v1.1