From 1fec56cf14675d1fcd5281c3e8bdfa0350894259 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 30 Jan 2017 22:26:26 +0000 Subject: re PR debug/79289 (DWARF info for typeof of C function with no args and no prototype is empty pointer) PR debug/79289 * dwarf2out.c (gen_type_die_with_usage): When picking a variant for FUNCTION_TYPE/METHOD_TYPE, use the first matching one. From-SVN: r245039 --- gcc/dwarf2out.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1b2c04c..0368f8d 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -24453,8 +24453,13 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die, but try to canonicalize. */ tree main = TYPE_MAIN_VARIANT (type); for (tree t = main; t; t = TYPE_NEXT_VARIANT (t)) - if (check_base_type (t, main) && check_lang_type (t, type)) - type = t; + { + if (check_base_type (t, main) && check_lang_type (t, type)) + { + type = t; + break; + } + } } else if (TREE_CODE (type) != VECTOR_TYPE && TREE_CODE (type) != ARRAY_TYPE) -- cgit v1.1