https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89546
--- Comment #7 from Martin Jambor <jamborm at gcc dot gnu.org> --- Right, I must have been looking at output of a patched compiler. Anyway, I believe I tracked it down to a bug in how SRA propagates write flag (since r247604). In one specific case, an access structure is not being requeued and the propagation stops prematurely. The following should fix it (I'll get back to this on Monday, let's see if I can construct a saner testcase): diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index eeef31ba496..077bd111344 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -2734,8 +2734,12 @@ propagate_subaccesses_across_link (struct access *lacc, struct access *racc) rchild->grp_hint = 1; new_acc->grp_hint |= new_acc->grp_read; - if (rchild->first_child) - ret |= propagate_subaccesses_across_link (new_acc, rchild); + if (rchild->first_child + && propagate_subaccesses_across_link (new_acc, rchild)) + { + ret = 1; + add_access_to_work_queue (new_acc); + } } else {