diff options
author | Chung-Lin Tang <cltang@codesourcery.com> | 2016-09-15 09:46:36 +0000 |
---|---|---|
committer | Chung-Lin Tang <cltang@gcc.gnu.org> | 2016-09-15 09:46:36 +0000 |
commit | 5560d026a64962d45a9f17b3a2928e1f0922a0f5 (patch) | |
tree | 27f8ed62ca6bbe83b2b61bc9a89808afba465de0 /gcc/ipa-icf.c | |
parent | 5334f73312e13d4ddc5968276c9ca94a98f28647 (diff) |
re PR fortran/72743 (ICE in get_constraint_for_ssa_var, at tree-ssa-structalias.c:2958)
2016-09-15 Chung-Lin Tang <cltang@codesourcery.com>
PR fortran/72743
* ipa-icf.c (set_alias_uids): New function.
(sem_variable::merge): Use set_alias_uids to set DECL_PT_UID of
all the merged variable's referring aliases.
testsuite/
* gfortran.dg/goacc/pr72743.f90: New test.
From-SVN: r240155
Diffstat (limited to 'gcc/ipa-icf.c')
-rw-r--r-- | gcc/ipa-icf.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index f29d929cf67..798d833971e 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -2133,6 +2133,23 @@ sem_variable::get_hash (void) return m_hash; } +/* Set all points-to UIDs of aliases pointing to node N as UID. */ + +static void +set_alias_uids (symtab_node *n, int uid) +{ + ipa_ref *ref; + FOR_EACH_ALIAS (n, ref) + { + if (dump_file) + fprintf (dump_file, " Setting points-to UID of [%s] as %d\n", + xstrdup_for_dump (ref->referring->asm_name ()), uid); + + SET_DECL_PT_UID (ref->referring->decl, uid); + set_alias_uids (ref->referring, uid); + } +} + /* Merges instance with an ALIAS_ITEM, where alias, thunk or redirection can be applied. */ @@ -2258,12 +2275,11 @@ sem_variable::merge (sem_item *alias_item) varpool_node::create_alias (alias_var->decl, decl); alias->resolve_alias (original); - if (DECL_PT_UID_SET_P (original->decl)) - SET_DECL_PT_UID (alias->decl, DECL_PT_UID (original->decl)); if (dump_file) - fprintf (dump_file, "Unified; Variable alias has been created.\n\n"); + fprintf (dump_file, "Unified; Variable alias has been created.\n"); + set_alias_uids (original, DECL_UID (original->decl)); return true; } } |