summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-07-19 07:12:23 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-07-19 07:12:23 +0000
commit8f0a1cecc582145903a2bc0d0e53f06f874fc831 (patch)
treedb216ac6324c32a5c4d26c9e5ee0c2c908bb38d3 /test/Transforms
parent98cd02622d716cc1e2b6002e7f96a7b8f38c7ab0 (diff)
downloadllvm-8f0a1cecc582145903a2bc0d0e53f06f874fc831.tar.gz
llvm-8f0a1cecc582145903a2bc0d0e53f06f874fc831.tar.bz2
llvm-8f0a1cecc582145903a2bc0d0e53f06f874fc831.tar.xz
Fix PR16651, an assert introduced in my recent re-work of the innards of
SROA. The crux of the issue is that now we track uses of a partition of the alloca in two places: the iterators over the partitioning uses and the previously collected split uses vector. We weren't accounting for the fact that the split uses might invalidate integer widening in ways other than due to their width (in this case due to being volatile). Further reduced testcase added to the tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SROA/basictest.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/SROA/basictest.ll b/test/Transforms/SROA/basictest.ll
index ca52dceb8f..9e5a26104d 100644
--- a/test/Transforms/SROA/basictest.ll
+++ b/test/Transforms/SROA/basictest.ll
@@ -1317,3 +1317,23 @@ define void @PR15805(i1 %a, i1 %b) {
%cond = load i64* %cond.in, align 8
ret void
}
+
+define void @PR16651(i8* %a) {
+; This test case caused a crash due to the volatile memcpy in combination with
+; lowering to integer loads and stores of a width other than that of the original
+; memcpy.
+;
+; CHECK-LABEL: @PR16651(
+; CHECK: alloca i16
+; CHECK: alloca i8
+; CHECK: alloca i8
+; CHECK: unreachable
+
+entry:
+ %b = alloca i32, align 4
+ %b.cast = bitcast i32* %b to i8*
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b.cast, i8* %a, i32 4, i32 4, i1 true)
+ %b.gep = getelementptr inbounds i8* %b.cast, i32 2
+ load i8* %b.gep, align 2
+ unreachable
+}