This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR debug/20161


Given this piece of invalid C,

struct XX;
typedef void *(*F) (struct XX []);

we ICE when generating debug info, because drarf2out.c does not
expect to find error_mark_nodes in the formal argument list. So
I just make gen_formal_types_die a little more roboust.

The patch below was bootstrapped and tested on x86_64-suse.
OK for mainline?


	PR debug/20161
	* dwarf2out.c (gen_formal_types_die): Robustify.

Index: dwarf2out.c
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.569
diff -u -3 -p -r1.569 dwarf2out.c
--- dwarf2out.c	27 Jan 2005 09:28:34 -0000	1.569
+++ dwarf2out.c	24 Feb 2005 21:55:27 -0000
@@ -11106,6 +11106,8 @@ gen_formal_types_die (tree function_or_m
       formal_type = TREE_VALUE (link);
       if (formal_type == void_type_node)
+      if (formal_type == error_mark_node)
+	break;
       /* Output a (nameless) DIE to represent the formal parameter itself.  */
       parm_die = gen_formal_parameter_die (formal_type, context_die);
@@ -11121,7 +11123,8 @@ gen_formal_types_die (tree function_or_m
   /* If this function type has an ellipsis, add a
      DW_TAG_unspecified_parameters DIE to the end of the parameter list.  */
-  if (formal_type != void_type_node)
+  if (formal_type != void_type_node
+      && formal_type != error_mark_node)
     gen_unspecified_parameters_die (function_or_method_type, context_die);
   /* Make our second (and final) pass over the list of formal parameter types

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]