+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.
+
2016-09-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/77514
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. */
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;
}
}
+2016-09-15 Chung-Lin Tang <cltang@codesourcery.com>
+
+ PR fortran/72743
+ * gfortran.dg/goacc/pr72743.f90: New test.
+
2016-09-15 Richard Biener <rguenther@suse.de>
* gcc.dg/fold-reassoc-2.c: Fix dump scan.
--- /dev/null
+! { dg-do compile }
+! { dg-additional-options "-O2" }
+
+program p
+ integer, parameter :: n = 8
+ integer :: i, z(n)
+ z = [(i, i=1,n)]
+ print *, z
+end
+subroutine s
+ integer, parameter :: n = 8
+ integer :: i, z(n)
+ z = [(i, i=1,n)]
+ print *, z
+end