This is an automated email from the git hooks/post-receive script.
unknown user pushed a commit to branch hjl/iamcu/improve in repository gcc.
commit 60d8da9e7e4195eaff9efc95e02c8c0a7ae326e2 Author: H.J. Lu hjl.tools@gmail.com Date: Wed Jul 8 08:28:03 2015 -0700
Skip error_mark_node type decls
There is no need to analyze error_mark_node type decls.
gcc/
PR target/66810 * varpool.cvarpool.c (varpool_node::analyze): Skip error_mark_node type decls.
gcc/testsuite/
PR target/66810 * gcc.target/i386/pr66810.c: New test. --- gcc/testsuite/gcc.target/i386/pr66810.c | 10 ++++++++++ gcc/varpool.c | 29 +++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/gcc/testsuite/gcc.target/i386/pr66810.c b/gcc/testsuite/gcc. [...] new file mode 100644 index 0000000..4778b37 --- /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" } */ +} diff --git a/gcc/varpool.c b/gcc/varpool.c index 10fa93c..f7c4d46 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -514,20 +514,25 @@ varpool_node::get_availability (void) void varpool_node::analyze (void) { - /* When reading back varpool at LTO time, we re-construct the queue in order - to have "needed" list right by inserting all needed nodes into varpool. - We however don't want to re-analyze already analyzed nodes. */ - if (!analyzed) + /* Skip error_mark_node type decls. */ + if (TREE_TYPE (decl) != error_mark_node) { - gcc_assert (!in_lto_p || symtab->function_flags_ready); - /* Compute the alignment early so function body expanders are - already informed about increased alignment. */ - align_variable (decl, 0); + /* When reading back varpool at LTO time, we re-construct the + queue in order to have "needed" list right by inserting all + needed nodes into varpool. We however don't want to re-analyze + already analyzed nodes. */ + if (!analyzed) + { + gcc_assert (!in_lto_p || symtab->function_flags_ready); + /* Compute the alignment early so function body expanders are + already informed about increased alignment. */ + align_variable (decl, 0); + } + if (alias) + resolve_alias (varpool_node::get (alias_target)); + else if (DECL_INITIAL (decl)) + record_references_in_initializer (decl, analyzed); } - if (alias) - resolve_alias (varpool_node::get (alias_target)); - else if (DECL_INITIAL (decl)) - record_references_in_initializer (decl, analyzed); analyzed = true; }