diff options
author | Joseph Myers <joseph@codesourcery.com> | 2006-09-09 00:41:21 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2006-09-09 00:41:21 +0100 |
commit | 3542a5c0f694a66f6e126b71a668c51a87f609f3 (patch) | |
tree | e813322b0c544ad6765cf8b4c6af8958787846b1 /gcc/c-decl.c | |
parent | a7b9d08c3563ec731b3213c279a25e66be384d0b (diff) | |
download | gcc-3542a5c0f694a66f6e126b71a668c51a87f609f3.zip gcc-3542a5c0f694a66f6e126b71a668c51a87f609f3.tar.gz gcc-3542a5c0f694a66f6e126b71a668c51a87f609f3.tar.bz2 |
re PR c/28504 (ICE with variable sized array)
PR c/28504
* c-tree.h (struct c_arg_info): Add pending_sizes.
* c-parser.c (c_parser_parms_declarator,
c_parser_parms_list_declarator): Initialize pending_sizes.
* c-decl.c (get_parm_info): Initialize pending_sizes.
(get_parm_info): Set pending_sizes.
(grokdeclarator): Call put_pending_sizes for parameters for
function definition only.
testsuite:
* gcc.dg/vla-10.c: New test.
From-SVN: r116789
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index cf89191..cbd356f 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4420,6 +4420,8 @@ grokdeclarator (const struct c_declarator *declarator, inner layer of declarator. */ arg_info = declarator->u.arg_info; arg_types = grokparms (arg_info, really_funcdef); + if (really_funcdef) + put_pending_sizes (arg_info->pending_sizes); /* Type qualifiers before the return type of the function qualify the return type, not the function type. */ @@ -4981,6 +4983,7 @@ get_parm_info (bool ellipsis) arg_info->tags = 0; arg_info->types = 0; arg_info->others = 0; + arg_info->pending_sizes = 0; arg_info->had_vla_unspec = current_scope->had_vla_unspec; /* The bindings in this scope must not get put into a block. @@ -5136,6 +5139,7 @@ get_parm_info (bool ellipsis) arg_info->tags = tags; arg_info->types = types; arg_info->others = others; + arg_info->pending_sizes = get_pending_sizes (); return arg_info; } |