+2017-09-06 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/82078
+ * tree-sra.c (sort_and_splice_var_accesses): Move call to
+ add_access_to_work_queue...
+ (build_accesses_from_assign): ...here.
+ (propagate_all_subaccesses): Make sure racc is the group
+ representative, if there is one.
+
2017-09-06 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82095
+2017-09-06 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/82078
+ * gcc.dg/tree-ssa/pr82078.c: New test.
+
2017-09-06 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82095
link->lacc = lacc;
link->racc = racc;
add_link_to_rhs (racc, link);
+ add_access_to_work_queue (racc);
+
/* Let's delay marking the areas as written until propagation of accesses
across link, unless the nature of rhs tells us that its data comes
from elsewhere. */
access->grp_total_scalarization = total_scalarization;
access->grp_partial_lhs = grp_partial_lhs;
access->grp_unscalarizable_region = unscalarizable_region;
- add_access_to_work_queue (access);
*prev_acc_ptr = access;
prev_acc_ptr = &access->next_grp;
struct access *racc = pop_access_from_work_queue ();
struct assign_link *link;
+ if (racc->group_representative)
+ racc= racc->group_representative;
gcc_assert (racc->first_link);
for (link = racc->first_link; link; link = link->next)