From b97d81535d07cfb6d1275f9c83d88af0dec96cd0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 15 Apr 2008 17:09:42 +0200 Subject: re PR c/35751 (ICE with invalid variable after #pragma omp parallel) PR c/35751 * c-decl.c (finish_decl): If extern or static var has variable size, set TREE_TYPE (decl) to error_mark_node. * decl.c (layout_var_decl): If extern or static var has variable size, set TREE_TYPE (decl) to error_mark_node. * gcc.dg/gomp/pr35751.c: New test. * g++.dg/gomp/pr35751.C: New test. From-SVN: r134317 --- gcc/c-decl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 22491aa..872fb8a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3481,7 +3481,10 @@ finish_decl (tree decl, tree init, tree asmspec_tree) if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) constant_expression_warning (DECL_SIZE (decl)); else - error ("storage size of %q+D isn%'t constant", decl); + { + error ("storage size of %q+D isn%'t constant", decl); + TREE_TYPE (decl) = error_mark_node; + } } if (TREE_USED (type)) -- cgit v1.1