https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128071

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-10-23
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that for BB vectorization we cannot determine

t.f90:11:30: missed:   can't determine dependence between MEM[(real(kind=8)[8]
*)_37][0] and MEM[(real(kind=8)[8] *)_38][1]
t.f90:11:30: note:  removing SLP instance operations starting from:
MEM[(real(kind=8)[8] *)_37][0] = _47;

that's the a(i)%v store vs the b(i)%v load when attempting to sink the
store across the loads:

  MEM[(real(kind=8)[8] *)_37][0] = _47;
  _53 = MEM[(real(kind=8)[8] *)_37][1];
  _54 = MEM[(real(kind=8)[8] *)_38][1];

but when vectorizing the loop

  _17 = MEM[(real(kind=8)[8] *)_37][_16];
  _18 = MEM[(real(kind=8)[8] *)_38][_16];
  _19 = _17 + _18;
  MEM[(real(kind=8)[8] *)_37][_16] = _19;

we can (and do) add a runtime alias check.  That's not possible when
doing BB vectorization.

So the issue is indeed that early unrolling defeats vectorization here.

Reply via email to