aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-02-05 05:01:25 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-02-05 04:01:25 +0000
commitd2b35c0464fc5b071f8bbf77079bce6a9170f15c (patch)
tree29af389ca0a77ee6adc0dafe66428beb68e0e468 /gcc/ipa.c
parent65a428db25019da409ab3ee919a3bb9d7c9257e6 (diff)
downloadgcc-d2b35c0464fc5b071f8bbf77079bce6a9170f15c.zip
gcc-d2b35c0464fc5b071f8bbf77079bce6a9170f15c.tar.gz
gcc-d2b35c0464fc5b071f8bbf77079bce6a9170f15c.tar.bz2
re PR ipa/61548 (FAIL: gcc.dg/tls/alias-1.c)
PR ipa/61548 * ipa.c (symbol_table::remove_unreachable_nodes): Fix ordering issue when removing varpool nodes. From-SVN: r220433
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 3626417..9cbd2da 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;
}