From cfc30fd17588446c8c54c6e1e77dec2dc18ba0fb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 6 Feb 2019 10:17:55 +0100 Subject: re PR c/89211 (ICE in int_mode_for_mode, at stor-layout.c:403) PR c/89211 * c-parser.c (c_parser_declaration_or_fndef): Don't update DECL_ARGUMENTS of d if it has been defined already. Use a single if instead of 3 nested ifs. * gcc.dg/pr89211.c: New test. From-SVN: r268574 --- gcc/c/c-parser.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 76f314e..cacbf0a 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -2154,10 +2154,12 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, tree d = start_decl (declarator, specs, false, chainon (postfix_attrs, all_prefix_attrs)); - if (d && TREE_CODE (d) == FUNCTION_DECL) - if (declarator->kind == cdk_function) - if (DECL_ARGUMENTS (d) == NULL_TREE) - DECL_ARGUMENTS (d) = declarator->u.arg_info->parms; + if (d + && TREE_CODE (d) == FUNCTION_DECL + && declarator->kind == cdk_function + && DECL_ARGUMENTS (d) == NULL_TREE + && DECL_INITIAL (d) == NULL_TREE) + DECL_ARGUMENTS (d) = declarator->u.arg_info->parms; if (omp_declare_simd_clauses.exists ()) { tree parms = NULL_TREE; -- cgit v1.1