diff options
author | Richard Henderson <rth@redhat.com> | 2004-12-18 20:07:54 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-12-18 20:07:54 -0800 |
commit | ca6af4f857cf2b93e89e99bad1dd2598c0b74f02 (patch) | |
tree | b619dd850f5531f64136b07519012853afe66500 /gcc/c-decl.c | |
parent | 8b0b9aefd29dfe6398857bcf5628662e2f0e21f6 (diff) | |
download | gcc-ca6af4f857cf2b93e89e99bad1dd2598c0b74f02.zip gcc-ca6af4f857cf2b93e89e99bad1dd2598c0b74f02.tar.gz gcc-ca6af4f857cf2b93e89e99bad1dd2598c0b74f02.tar.bz2 |
c-decl.c (finish_struct): Add DECL_EXPR for variable sized structures seen inside functions.
* c-decl.c (finish_struct): Add DECL_EXPR for variable sized
structures seen inside functions.
From-SVN: r92371
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index b76e274..26caa2c 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5401,6 +5401,12 @@ finish_struct (tree t, tree fieldlist, tree attributes) /* Finish debugging output for this type. */ rest_of_type_compilation (t, toplevel); + /* If we're inside a function proper, i.e. not file-scope and not still + parsing parameters, then arrange for the size of a variable sized type + to be bound now. */ + if (cur_stmt_list && variably_modified_type_p (t, NULL)) + add_stmt (build_stmt (DECL_EXPR, build_decl (TYPE_DECL, NULL, t))); + return t; } |