diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-05 04:01:25 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-05 04:01:25 +0000 |
commit | e7610412a56f260753e7cde22ccbf12b005bee9c (patch) | |
tree | 29af389ca0a77ee6adc0dafe66428beb68e0e468 /gcc/ipa.c | |
parent | a70a8c3aa7498d0eb2c928873b69400e161d24da (diff) | |
download | gcc-e7610412a56f260753e7cde22ccbf12b005bee9c.tar.gz |
PR ipa/61548
* ipa.c (symbol_table::remove_unreachable_nodes): Fix ordering issue
when removing varpool nodes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220433 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c index 36264175f57..9cbd2da8023 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -597,8 +597,20 @@ symbol_table::remove_unreachable_nodes (FILE *file) or not. */ && (!flag_ltrans || !DECL_EXTERNAL (vnode->decl))) { + struct ipa_ref *ref = NULL; + + /* First remove the aliases, so varpool::remove can possibly lookup + the constructor and save it for future use. */ + while (vnode->iterate_direct_aliases (0, ref)) + { + if (file) + fprintf (file, " %s/%i", ref->referred->name (), + ref->referred->order); + ref->referring->remove (); + } if (file) fprintf (file, " %s/%i", vnode->name (), vnode->order); + vnext = next_variable (vnode); vnode->remove (); changed = true; } |