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

--- Comment #31 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Jiu Fu Guo from comment #30)
> (In reply to Wilco from comment #29)

> > The key question remains whether it is legal to assume the limit implies the
> > memory is valid and use wider accesses.

> If unaligned access is support, it would be valid to access the memory.
> Otherwise, checking like ((pb&7) == (cur & 7)) would cost an additional
> test, and it may not sure likely to be true.

If both pointers are aligned it would be safe indeed, but if unaligned they
will access up to 7 bytes after the first match. And that's not safe without
knowing the underlying buffer bounds. See eg. comment #3.

Reply via email to