Bug 401112 - LLVM 5.0 generates comparison against partially initialized data.
Summary: LLVM 5.0 generates comparison against partially initialized data.
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.14 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Nicolas B. Pierron
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-16 16:58 UTC by Nicolas B. Pierron
Modified: 2018-11-21 08:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Spec rule for SUBL-Cond{BE,NBE} with ((1 << N) - 1) immediate (4.67 KB, patch)
2018-11-16 16:58 UTC, Nicolas B. Pierron
Details
Spec rule for SUBL-Cond{BE,NBE} with ((1 << N) - 1) immediate (5.94 KB, text/plain)
2018-11-20 16:54 UTC, Nicolas B. Pierron
Details
Spec rule for SUBL-Cond{BE,NBE} with ((1 << N) - 1) immediate (5.55 KB, patch)
2018-11-21 08:02 UTC, Julian Seward
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas B. Pierron 2018-11-16 16:58:30 UTC
Created attachment 116354 [details]
Spec rule for SUBL-Cond{BE,NBE} with ((1 << N) - 1) immediate

SUMMARY
https://bugzilla.mozilla.org/show_bug.cgi?id=1489572#c47

LLVM 5.0 generates SUBL {CondBE / CondNBE} with power of 2 minus 1 immediate, to compare the high bits of data structures, where the bottom of the data structure might have undefined bits.

The attached patch copies the spec rule which were added previous and changes the way N is computed, based on the ((1 << N) - 1) pattern instead. Testing on the initial issue seems to fix the problem.

STEPS TO REPRODUCE
1. https://bugzilla.mozilla.org/show_bug.cgi?id=1489572#c47

OBSERVED RESULT
Conditional jump or move depends on uninitialised value(s)

EXPECTED RESULT
Nothing.
Comment 1 Nicolas B. Pierron 2018-11-20 16:54:09 UTC
Created attachment 116428 [details]
Spec rule for SUBL-Cond{BE,NBE} with ((1 << N) - 1) immediate

This is an updated version of the patch which merges both branches as they produce the same test.
Comment 2 Julian Seward 2018-11-21 08:02:33 UTC
Created attachment 116436 [details]
Spec rule for SUBL-Cond{BE,NBE} with ((1 << N) - 1) immediate

With commoning up of the isU64_1_shl_N .. routines.