aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-06-08 06:41:55 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-06-08 06:41:55 +0000
commit08203f73d119a1f01c2b604ba445ef29bdb1b410 (patch)
tree534f99d90a2c95da95dd956a96021632fb4b1715 /gcc/c
parent92a5f2bae5d0528d2eab43a12bef408a0ed781d5 (diff)
downloadgcc-08203f73d119a1f01c2b604ba445ef29bdb1b410.zip
gcc-08203f73d119a1f01c2b604ba445ef29bdb1b410.tar.gz
gcc-08203f73d119a1f01c2b604ba445ef29bdb1b410.tar.bz2
re PR c/71426 (gcc ICE on x86_64-linux-gnu in get_parm_info, at c/c-decl.c:7059)
PR c/71426 * c-decl.c (get_parm_info): Don't crash on an assert on invalid code. * gcc.dg/noncompile/pr71426.c: New test. From-SVN: r237196
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog4
-rw-r--r--gcc/c/c-decl.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 8617f08..9f0b91a 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -3,6 +3,10 @@
PR c/71418
* c-decl.c (grokdeclarator): Check TYPE_P.
+ PR c/71426
+ * c-decl.c (get_parm_info): Don't crash on an assert on invalid
+ code.
+
2016-06-07 David Malcolm <dmalcolm@redhat.com>
* c-parser.c (c_parser_postfix_expression): In __builtin_offsetof
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index ac83e2f..5c08c59 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -7054,9 +7054,9 @@ get_parm_info (bool ellipsis, tree expr)
break;
case FUNCTION_DECL:
- /* FUNCTION_DECLs appear when there is an implicit function
- declaration in the parameter list. */
- gcc_assert (b->nested);
+ /* FUNCTION_DECLs appear when there is an implicit function
+ declaration in the parameter list. */
+ gcc_assert (b->nested || seen_error ());
goto set_shadowed;
case CONST_DECL: