diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-20 02:58:42 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-20 02:58:42 +0000 |
commit | 38889e9875adacc954b5885f2f2f98d718a04ca5 (patch) | |
tree | 7f27ae05149a192cf7c25b6f4f20f63d97ad9d9a /gcc/ipa.c | |
parent | dc66dd888d68508cded7c5f1e2c92940d5822f52 (diff) | |
download | gcc-38889e9875adacc954b5885f2f2f98d718a04ca5.tar.gz |
PR tree-optimization/63255
* ipa.c (symbol_table::remove_unreachable_nodes): Fix ordering
issue in setting body_removed flag.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215415 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c index 5afacd87b7a..3c35e473e97 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -538,6 +538,11 @@ symbol_table::remove_unreachable_nodes (bool before_inlining_p, FILE *file) fprintf (file, " %s", vnode->name ()); changed = true; } + /* Keep body if it may be useful for constant folding. */ + if ((init = ctor_for_folding (vnode->decl)) == error_mark_node) + vnode->remove_initializer (); + else + DECL_INITIAL (vnode->decl) = init; vnode->body_removed = true; vnode->definition = false; vnode->analyzed = false; @@ -545,11 +550,6 @@ symbol_table::remove_unreachable_nodes (bool before_inlining_p, FILE *file) vnode->remove_from_same_comdat_group (); - /* Keep body if it may be useful for constant folding. */ - if ((init = ctor_for_folding (vnode->decl)) == error_mark_node) - vnode->remove_initializer (); - else - DECL_INITIAL (vnode->decl) = init; vnode->remove_all_references (); } else |