https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88398
--- Comment #46 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> --- (In reply to Jiu Fu Guo from comment #45) > (In reply to Wilco from comment #44) > > (In reply to Jiu Fu Guo from comment #43) > > > To handle vectorization for this kind of code, it needs to overcome the > > > hard > > > issue mentioned in comment #5: the loop has 2 exits. > > > > Yes and that also implies vector loads are unsafe unless they are > > non-faulting. Few ISAs have such support. > > Since this is a loop, can we assume it is safe if reading data less than the > upbound of the loop and if two buffers are not cross pages? > something like: "while (++len != max - sizeof(T)) { T a = *(T*)(p+len)..}" > and "p & page_size_mask == (p+len) & page_size_mask". In other words, if the underlying buffers cover the low-bound and upbound of the loop. We may assume it, but hard to prove it. In which circumstances, we can prove it? Or does it make sense to provide a flag to let user confirm it is safe?