diff options
author | David Green <david.green@arm.com> | 2018-07-28 08:20:10 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2018-07-28 08:20:10 +0000 |
commit | fc4b0fe0a2c3a0908afdb625f0cef843acdc126c (patch) | |
tree | 834b0cb3b5376bed6c955ada249a426dbf3e38d2 /llvm/lib/Target/AMDGPU/AMDGPULowerKernelArguments.cpp | |
parent | f947608ddfe026eaf013524e5fe09d3c425a5cf0 (diff) | |
download | bcm5719-llvm-fc4b0fe0a2c3a0908afdb625f0cef843acdc126c.tar.gz bcm5719-llvm-fc4b0fe0a2c3a0908afdb625f0cef843acdc126c.zip |
[GlobalOpt] Test array indices inside structs for out-of-bounds accesses
We now, from clang, can turn arrays of
static short g_data[] = {16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0};
into structs of the form
@g_data = internal global <{ [8 x i16], [8 x i16] }> ...
GlobalOpt will incorrectly SROA it, not realising that the access to the first
element may overflow into the second. This fixes it by checking geps more
thoroughly.
I believe this makes the globalsra-partial.ll test case invalid as the %i value
could be out of bounds. I've re-purposed it as a negative test for this case.
Differential Revision: https://reviews.llvm.org/D49816
llvm-svn: 338192
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPULowerKernelArguments.cpp')
0 files changed, 0 insertions, 0 deletions