Bug 394227 - [x86] False negative "uninitialised value" report due to not recognizing simd registers clear by pcmp*
Summary: [x86] False negative "uninitialised value" report due to not recognizing simd...
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.12.0
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-14 04:03 UTC by myocytebd
Modified: 2020-02-03 00:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description myocytebd 2018-05-14 04:03:28 UTC
It is common to generate constants in simd registers.
It typically begins by clearing the simd register to all-one, by pcmp* family.
For example:
pcmpeqw xmm0, xmm0

However, valgrind 3.12 (Ubuntu x64) fails to recognize this combination and populates uninitialized values around.
(Changing it to load or load+shuffle will suppress the warning)
Comment 1 Philippe Waroquiers 2018-05-14 20:53:43 UTC
The title of the bug report indicates x86, but below you indicate x64.
Is this a problem with 32 bits intel or 64 bits intel ?

Do you have a small compilable reproducer ?
I am sure that will help the knowledgeable people (i.e. not me :))
to analyse and maybe fix your problem.
Comment 2 ace17 2018-05-23 11:00:11 UTC
Might be related to: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/238
Comment 3 Julian Seward 2018-09-03 06:36:36 UTC
This is probably easy to fix, but we need a test case that shows the
problem for all pcmpeq variants that you are interested in.  Can you
supply one?
Comment 4 nh2 2020-02-03 00:58:56 UTC
The specific case of `pcmpeqw xmm0, xmm0` is claimed to be fixed in issue https://bugs.kde.org/show_bug.cgi?id=290006.

Yet, there are still issues with valgrind on libjpeg-turbo (see https://github.com/libjpeg-turbo/libjpeg-turbo/issues/277#issuecomment-581198382), suggesting that either the fix is incomplete or that other instructions are involved.
Comment 5 nh2 2020-02-03 00:59:29 UTC
Also related: https://bugs.kde.org/show_bug.cgi?id=398153