aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2017-01-30 22:26:26 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-01-30 22:26:26 +0000
commit1fec56cf14675d1fcd5281c3e8bdfa0350894259 (patch)
tree0c263980402b4759a96b8e99ceddf1c98f4833a5 /gcc/dwarf2out.c
parent25a5787d468c5622471aa0a8b371d989db7ff790 (diff)
downloadgcc-1fec56cf14675d1fcd5281c3e8bdfa0350894259.zip
gcc-1fec56cf14675d1fcd5281c3e8bdfa0350894259.tar.gz
gcc-1fec56cf14675d1fcd5281c3e8bdfa0350894259.tar.bz2
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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c9
1 files changed, 7 insertions, 2 deletions
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)