From fabb2a3def3f31878a3820e21d0630452c0d2f5b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 20 Oct 2015 15:20:29 +0000 Subject: [PATCH] Skip local error_mark_node decls There is no need to finalize local error_mark_node decls. gcc/ PR target/66810 * cgraphbuild.c (pass_build_cgraph_edges::execute): Skip local error_mark_node decls. gcc/testsuite/ PR target/66810 * gcc.target/i386/pr66810.c: New test. From-SVN: r229083 --- gcc/ChangeLog | 6 ++++++ gcc/cgraphbuild.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr66810.c | 10 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr66810.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3394723d7d..44760d41734 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-20 H.J. Lu + + PR target/66810 + * cgraphbuild.c (pass_build_cgraph_edges::execute): Skip local + error_mark_node decls. + 2015-10-20 H.J. Lu PR target/67963 diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index 33b01be83ac..b0815c987cb 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -381,7 +381,8 @@ pass_build_cgraph_edges::execute (function *fun) FOR_EACH_LOCAL_DECL (fun, ix, decl) if (TREE_CODE (decl) == VAR_DECL && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)) - && !DECL_HAS_VALUE_EXPR_P (decl)) + && !DECL_HAS_VALUE_EXPR_P (decl) + && TREE_TYPE (decl) != error_mark_node) varpool_node::finalize_decl (decl); record_eh_tables (node, fun); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7d4c6f83276..1d8f1cb8c9e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-20 H.J. Lu + + PR target/66810 + * gcc.target/i386/pr66810.c: New test. + 2015-10-20 H.J. Lu PR target/67963 diff --git a/gcc/testsuite/gcc.target/i386/pr66810.c b/gcc/testsuite/gcc.target/i386/pr66810.c new file mode 100644 index 00000000000..4778b37a244 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr66810.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-mno-sse -mno-mmx -miamcu" } */ + +int vv; + +void +i (void) +{ + static int a[vv]; /* { dg-error "storage size" } */ +} -- 2.30.2