On Wed, Jan 08, 2020 at 09:24:48PM -0700, Jeff Law wrote:
> On Wed, 2020-01-08 at 17:23 +0000, Martin Sebor wrote:
> > A recent improvement to the vectorizer (r278334 if my bisection
> > is right) can transform multiple stores to adjacent struct members
> > into single vectorized assignments that write over all the members
> > in a single MEM_REF.  These are then flagged by -Wstringop-overflow
> > thanks to its also recently enhanced past-the-end store detection.
> > The warnings have been causing failures in some of Jeff's periodic
> > builds (e.g., in cjdns-v20.4).
> > 
> > Reliably distinguishing these transformed, multi-member, MEM_REF
> > stores from accidental bugs the warning is designed to detect will
> > require annotating them somehow at the time they are introduced.
> > Until that happens, the attached patch simply tweaks the logic that
> > determines the size of the destination objects to punt on these
> > vectorized MEM_REFs.
> I thought we had other code which could combine stores into consecutive
> memory locations that might run afoul of this warning as well.  But I
> can't seem to find that code -- we may well have throttled it a while
> back because of data store races.

E.g. store-merging does that, but that runs fairly late.
And as it is mentioned in other PRs, if the warning code determines anything
e.g. from pointers used in MEM_REFs, then any kind of value numbering can cause
that, as for pointers the optimizers only care about the value and not
access path.  So all those cases e.g. with union where we access one union
member at one point and another one later in the same function and the two
pointers through which the access is made have the same value.

        Jakub

Reply via email to