Safe transposition of logical and operands
Martin Uecker
muecker@gwdg.de
Mon Sep 18 19:09:47 GMT 2023
Am Montag, dem 18.09.2023 um 19:56 +0200 schrieb Paul Floyd via Gcc:
>
> On 18-09-23 16:55, Richard Biener wrote:
>
> > What you could do is report the access only on the point of use of
> > the accessed value? (and disregard when the register holding the
> > value is re-used)
>
> Hi Richard
>
> Not sure that I follow what you're saying.
>
> memcheck triggers errors like this at conditional branching opcodes
> where it determines that the condition is undefined.
>
> There are mechanisms to de-duplicate errors, so once an error is emitted
> it won't be printed again.
>
> However, one of our goals is no false positives. This is one example
> that is slipping through the cracks.
>
I do not understand why memcheck cares about the potential trap when
deciding to do the backwards transformation that combines the two
comparisons? Can't you just remove this condition? I assume it
is meant as a filter to only transform cases which really come
from an '&&' condition in the source, but as this example show, this
is too strict. Or am I missing something?
Martin
More information about the Gcc
mailing list