llvm.org GIT mirror llvm / f88380b
Fix PR1782, patch by Wojtek Matyjewicz! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44733 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
2 changed file(s) with 35 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
729729 if (const ArrayType *AT = dyn_cast(BasePtr1Ty)) {
730730 if (Op1C->getZExtValue() >= AT->getNumElements())
731731 return MayAlias; // Be conservative with out-of-range accesses
732 } else if (const VectorType *PT = dyn_cast(BasePtr1Ty)) {
733 if (Op1C->getZExtValue() >= PT->getNumElements())
732 } else if (const VectorType *VT = dyn_cast(BasePtr1Ty)) {
733 if (Op1C->getZExtValue() >= VT->getNumElements())
734734 return MayAlias; // Be conservative with out-of-range accesses
735735 }
736736
755755 if (Op2) {
756756 if (const ConstantInt *Op2C = dyn_cast(Op2)) {
757757 // If this is an array index, make sure the array element is in range.
758 if (const ArrayType *AT = dyn_cast(BasePtr1Ty)) {
758 if (const ArrayType *AT = dyn_cast(BasePtr2Ty)) {
759759 if (Op2C->getZExtValue() >= AT->getNumElements())
760760 return MayAlias; // Be conservative with out-of-range accesses
761 } else if (const VectorType *VT = dyn_cast(BasePtr1Ty)) {
761 } else if (const VectorType *VT = dyn_cast(BasePtr2Ty)) {
762762 if (Op2C->getZExtValue() >= VT->getNumElements())
763763 return MayAlias; // Be conservative with out-of-range accesses
764764 }
0 ; RUN: llvm-as < %s | opt -gvn -disable-output
1 ; PR1782
2
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
4 target triple = "x86_64-unknown-linux-gnu"
5 %struct.device = type { [20 x i8] }
6 %struct.pci_device_id = type { i32, i32, i32, i32, i32, i32, i64 }
7 %struct.usb_bus = type { %struct.device* }
8 %struct.usb_hcd = type { %struct.usb_bus, [0 x i64] }
9 @pci_ids = external constant [1 x %struct.pci_device_id] ; <[1 x %struct.pci_device_id]*> [#uses=1]
10
11 @__mod_pci_device_table = alias [1 x %struct.pci_device_id]* @pci_ids ; <[1 x %struct.pci_device_id]*> [#uses=0]
12
13 define i32 @ehci_pci_setup(%struct.usb_hcd* %hcd) {
14 entry:
15 %tmp14 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 0, i32 0 ; <%struct.device**> [#uses=1]
16 %tmp15 = load %struct.device** %tmp14, align 8 ; <%struct.device*> [#uses=0]
17 br i1 false, label %bb25, label %return
18
19 bb25: ; preds = %entry
20 br i1 false, label %cond_true, label %return
21
22 cond_true: ; preds = %bb25
23 %tmp601 = getelementptr %struct.usb_hcd* %hcd, i32 0, i32 1, i64 2305843009213693951 ; [#uses=1]
24 %tmp67 = bitcast i64* %tmp601 to %struct.device** ; <%struct.device**> [#uses=1]
25 %tmp68 = load %struct.device** %tmp67, align 8 ; <%struct.device*> [#uses=0]
26 ret i32 undef
27
28 return: ; preds = %bb25, %entry
29 ret i32 undef
30 }