diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-02-06 10:17:55 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-02-06 10:17:55 +0100 |
commit | cfc30fd17588446c8c54c6e1e77dec2dc18ba0fb (patch) | |
tree | b3e204b15280ca3ebbe512488f50c4bed134d09c /gcc/c/c-parser.c | |
parent | 4763581763de6049c938ea7129d738d497004a06 (diff) | |
download | gcc-cfc30fd17588446c8c54c6e1e77dec2dc18ba0fb.zip gcc-cfc30fd17588446c8c54c6e1e77dec2dc18ba0fb.tar.gz gcc-cfc30fd17588446c8c54c6e1e77dec2dc18ba0fb.tar.bz2 |
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
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; |