aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-07 23:55:48 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-07 23:55:48 +0100
commitc4581bbfb4a20bce2fb9d9dace1f30e4d5a494e8 (patch)
tree811169e27ff0b6859fe311ad5efb35c4b677067e /gcc/c/c-decl.c
parent2d8d93c783dd43769075fa0474d670f6fb4a85f1 (diff)
downloadgcc-c4581bbfb4a20bce2fb9d9dace1f30e4d5a494e8.zip
gcc-c4581bbfb4a20bce2fb9d9dace1f30e4d5a494e8.tar.gz
gcc-c4581bbfb4a20bce2fb9d9dace1f30e4d5a494e8.tar.bz2
re PR c/88701 (Internal compiler error for valid program using compound literal with variably modified type.)
PR c/88701 * c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl if current_function_decl is non-NULL. * gcc.dg/pr88701.c: New test. From-SVN: r267667
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 5c7232f..57049f8 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -5438,7 +5438,7 @@ build_compound_literal (location_t loc, tree type, tree init, bool non_const,
pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
}
- else
+ else if (current_function_decl)
pushdecl (decl);
if (non_const)