aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.com>2016-03-04 22:22:01 -0700
committerJeff Law <law@gcc.gnu.org>2016-03-04 22:22:01 -0700
commit29b9828fa425602f306d28b7ede79b4b0ac2e6f7 (patch)
tree612123679993677e605b94e52f3afd62dde24153 /gcc/c
parent5c03c4211d2a631d568237c36689b3826e4ac5b7 (diff)
downloadgcc-29b9828fa425602f306d28b7ede79b4b0ac2e6f7.zip
gcc-29b9828fa425602f306d28b7ede79b4b0ac2e6f7.tar.gz
gcc-29b9828fa425602f306d28b7ede79b4b0ac2e6f7.tar.bz2
re PR c/69824 (internal compiler error in unshare_body)
PR c/69824 * c-decl.c (get_parm_info): Don't queue implicit function declarations for later. PR c/69824 * gcc.dg/pr69824.c: New test. From-SVN: r234000
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c15
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 1fe4f82..2e54e56 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-04 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR c/69824
+ * c-decl.c (get_parm_info): Don't queue implicit function declarations
+ for later.
+
2016-03-04 Marek Polacek <polacek@redhat.com>
PR c/69798
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 298036a..bab4715 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -7050,25 +7050,28 @@ get_parm_info (bool ellipsis, tree expr)
vec_safe_push (tags, tag);
break;
+ case FUNCTION_DECL:
+ /* FUNCTION_DECLs appear when there is an implicit function
+ declaration in the parameter list. */
+ gcc_assert (b->nested);
+ goto set_shadowed;
+
case CONST_DECL:
case TYPE_DECL:
- case FUNCTION_DECL:
/* CONST_DECLs appear here when we have an embedded enum,
and TYPE_DECLs appear here when we have an embedded struct
or union. No warnings for this - we already warned about the
- type itself. FUNCTION_DECLs appear when there is an implicit
- function declaration in the parameter list. */
+ type itself. */
/* When we reinsert this decl in the function body, we need
to reconstruct whether it was marked as nested. */
- gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
- ? b->nested
- : !b->nested);
+ gcc_assert (!b->nested);
DECL_CHAIN (decl) = others;
others = decl;
/* fall through */
case ERROR_MARK:
+ set_shadowed:
/* error_mark_node appears here when we have an undeclared
variable. Just throw it away. */
if (b->id)