fix PR5016, a crash I introduced in GVN handing first class

arrays and structs, which cannot be bitcast to integers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-09-21 17:24:04 +00:00
parent f8349ac8b8
commit 8b2bc3d574
2 changed files with 52 additions and 10 deletions

View File

@@ -13,6 +13,20 @@ define i32 @test0(i32 %V, i32* %P) {
; CHECK: ret i32 %V
}
;;===----------------------------------------------------------------------===;;
;; Tests for crashers
;;===----------------------------------------------------------------------===;;
;; PR5016
define i8 @crash0({i32, i32} %A, {i32, i32}* %P) {
store {i32, i32} %A, {i32, i32}* %P
%X = bitcast {i32, i32}* %P to i8*
%Y = load i8* %X
ret i8 %Y
}
;;===----------------------------------------------------------------------===;;
;; Store -> Load and Load -> Load forwarding where src and dst are different
;; types, but where the base pointer is a must alias.