summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-05 04:01:25 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-05 04:01:25 +0000
commite7610412a56f260753e7cde22ccbf12b005bee9c (patch)
tree29af389ca0a77ee6adc0dafe66428beb68e0e468 /gcc/ipa.c
parenta70a8c3aa7498d0eb2c928873b69400e161d24da (diff)
downloadgcc-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.c12
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;
}