diff options
author | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2022-09-29 18:22:56 +0200 |
---|---|---|
committer | Bjorn Pettersson <bjorn.a.pettersson@ericsson.com> | 2022-09-29 21:24:31 +0200 |
commit | 0513b0305acde91a0a5f7f5ea4061476011f0d1d (patch) | |
tree | 0e050d89c72f0bc1dd61ec80e6e160ec58e6695e /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | e4fcbf3950092a78852e09f7cd8fe1d703967516 (diff) | |
download | llvm-0513b0305acde91a0a5f7f5ea4061476011f0d1d.zip llvm-0513b0305acde91a0a5f7f5ea4061476011f0d1d.tar.gz llvm-0513b0305acde91a0a5f7f5ea4061476011f0d1d.tar.bz2 |
[X86] Avoid miscompile in combineOr (X86ISelLowering.cpp)
In combineOr (X86ISelLowering.cpp) there is a DAG combine that rewrite
a "(0 - SetCC) | C" pattern into something simpler given that a LEA
can be used. Another requirement is that C has some specific value,
for example 1 or 7. When checking those requirements the code used a
32-bit unsigned variable to store the value of C. So for a 64-bit OR
this could miscompile in case any of the 32 most significant bits in
C were non zero.
This patch adds fixes the bug by using a large enough type for the
C value.
The faulty code seem to have been introduced by commit 9bceb8981d32fe
(D131358).
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D134892
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions