aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-02-06 10:17:55 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-02-06 10:17:55 +0100
commitcfc30fd17588446c8c54c6e1e77dec2dc18ba0fb (patch)
treeb3e204b15280ca3ebbe512488f50c4bed134d09c /gcc/c
parent4763581763de6049c938ea7129d738d497004a06 (diff)
downloadgcc-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')
-rw-r--r--gcc/c/ChangeLog7
-rw-r--r--gcc/c/c-parser.c10
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 9bb8351..ebe944a 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,10 @@
+2019-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2019-02-06 Joseph Myers <joseph@codesourcery.com>
PR c/88584
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;