aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-08-27 19:34:43 +0000
committerPhilip Reames <listmail@philipreames.com>2019-08-27 19:34:43 +0000
commit2694522f1345f0baded022515728cf033b4694d1 (patch)
tree833a11661927dbb2178aca864308ccd5796f37ae /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parenteac783a900d7ed5643ea30038df36684a6e46654 (diff)
downloadllvm-2694522f1345f0baded022515728cf033b4694d1.zip
llvm-2694522f1345f0baded022515728cf033b4694d1.tar.gz
llvm-2694522f1345f0baded022515728cf033b4694d1.tar.bz2
[Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process
The code we had isSafeToLoadUnconditionally was blatantly wrong. This function takes a "Size" argument which is supposed to describe the span loaded from. Instead, the code use the size of the pointer passed (which may be unrelated!) and only checks that span. For any Size > LoadSize, this can and does lead to miscompiles. Worse, the generic code just a few lines above correctly handles the cases which *are* valid. So, let's delete said code. Removing this code revealed two issues: 1) As noted by jdoerfert the removed code incorrectly handled external globals. The test update in SROA is to stop testing incorrect behavior. 2) SROA was confusing bytes and bits, but this wasn't obvious as the Size parameter was being essentially ignored anyway. Fixed. Differential Revision: https://reviews.llvm.org/D66778 llvm-svn: 370102
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
0 files changed, 0 insertions, 0 deletions