|
From: Carl E. L. <ce...@us...> - 2017-04-25 19:22:45
|
> On Tue, 2017-04-25 at 11:19 -0700, Patrick J. LoPresti wrote:
>> This sort of code is supposed to be handled by
>> "--partial-loads-ok=yes". (Which should be made the default, in my
>> opinion.)
>>
>> If that does not work, it is a bug in the partial-loads-ok support.
On Tue, 2017-04-25 at 20:32 +0200, Julian Seward wrote:
> > The inlined code has two load double word instructions (ldbrx inst) that
> > are partially uninitialized. Following the two double word loads we do a
> > subf. instruction to subtract the values and set the condition code.
>
> Does it help to run with --expensive-definedness-checks=yes? That
> enables more accurate but more expensive definedness tracking for
> subtracts, among other things.
>
> J
>
Julian, Patrick:
So I tried the --partial-loads first. It didn't change things.
valgrind --partial-loads-ok=yes ./bug80497-gcc7 --track-origins=yes
==32322== Memcheck, a memory error detector
==32322== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==32322== Using Valgrind-3.13.0.SVN and LibVEX; rerun with -h for copyright info
==32322== Command: ./bug80497-gcc7 --track-origins=yes
==32322==
==32322== Conditional jump or move depends on uninitialised value(s)
==32322== at 0x100004C8: main (bug80497.c:9)
==32322==
==32322== Syscall param exit_group(status) contains uninitialised byte(s)
==32322== at 0x41BDEA4: _Exit (_exit.c:31)
==32322== by 0x411520B: __run_exit_handlers (exit.c:98)
==32322== by 0x40F29A3: generic_start_main.isra.0 (libc-start.c:323)
==32322== by 0x40F2BB7: (below main) (libc-start.c:102)
I then tried the expensive-definedness-checking
valgrind --partial-loads-ok=yes ./bug80497-gcc7 --track-origins=yes
==32322== Memcheck, a memory error detector
==32322== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==32322== Using Valgrind-3.13.0.SVN and LibVEX; rerun with -h for copyright info
==32322== Command: ./bug80497-gcc7 --track-origins=yes
==32322==
==32322== Conditional jump or move depends on uninitialised value(s)
==32322== at 0x100004C8: main (bug80497.c:9)
==32322==
==32322== Syscall param exit_group(status) contains uninitialised byte(s)
==32322== at 0x41BDEA4: _Exit (_exit.c:31)
==32322== by 0x411520B: __run_exit_handlers (exit.c:98)
==32322== by 0x40F29A3: generic_start_main.isra.0 (libc-start.c:323)
==32322== by 0x40F2BB7: (below main) (libc-start.c:102)
I did try recompiling the test case with -fno-builtin-strcmp and running without any
additional Valgrind flags and still got the issue. The option does not turn off the
optimization of the strcmp. Even if it did, I am not sure that would be a satisfactory
solution for the user in this case. I will have to check with them for sure.
Other ideas?
Carl Love
|