From bb686a19e90ef34eb921e116dcf81a25aaa02cb4 Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Mon, 31 Mar 2008 19:37:45 +0000 Subject: re PR c/35750 (ICE with invalid old-style parameter declaration) PR c/35750 * c-decl.c (store_parm_decls_oldstyle): Skip invalid parameters. * gcc.dg/old-style-param-1.c: New test. From-SVN: r133771 --- gcc/c-decl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 04b36d5..d86bca0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6483,8 +6483,10 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) /* Type for passing arg must be consistent with that declared for the arg. ISO C says we take the unqualified type for parameters declared with qualified type. */ - if (!comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), - TYPE_MAIN_VARIANT (TREE_VALUE (type)))) + if (TREE_TYPE (parm) != error_mark_node + && TREE_TYPE (type) != error_mark_node + && !comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), + TYPE_MAIN_VARIANT (TREE_VALUE (type)))) { if (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) == TYPE_MAIN_VARIANT (TREE_VALUE (type))) -- cgit v1.1