re PR debug/79289 (DWARF info for typeof of C function with no args and no prototype...
authorIan Lance Taylor <iant@google.com>
Mon, 30 Jan 2017 22:26:26 +0000 (22:26 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 30 Jan 2017 22:26:26 +0000 (22:26 +0000)
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/ChangeLog
gcc/dwarf2out.c

index ca356c6cef98135067645ace65d9da6392483d1b..21fb141929935ff659dacd35df6cede6a7d798f8 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-30  Ian Lance Taylor  <iant@google.com>
+
+       PR debug/79289
+       * dwarf2out.c (gen_type_die_with_usage): When picking a variant
+       for FUNCTION_TYPE/METHOD_TYPE, use the first matching one.
+
 2017-01-30  Martin Sebor  <msebor@redhat.com>
 
        * doc/invoke.texi (-Wformat-truncation=1): Fix typo.
index 1b2c04cc00a3a17510caf00561557518a4b2da24..0368f8d0d14da56475f250a52694c909a5cb1129 100644 (file)
@@ -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)