llvm.org GIT mirror llvm / 15c0e3e
Merge 80762 from mainline. fix PR4848 an infinite loop when indexing down through a recursive gep and we get the original pointer type. This doesn't mean that we're at the first pointer being indexed. Correct the predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81028 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
2 changed file(s) with 25 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
171171 do {
172172 if (const SequentialType *ATy = dyn_cast(Ty)) {
173173 // The only pointer indexing we'll do is on the first index of the GEP.
174 if (isa(ATy) && ATy != Ptr->getType())
174 if (isa(ATy) && !NewIdxs.empty())
175175 break;
176176 // Determine which element of the array the offset points into.
177177 APInt ElemSize(BitWidth, TD->getTypeAllocSize(ATy->getElementType()));
0 ; RUN: llvm-as < %s | opt -constprop | llvm-dis
1 ; PR4848
2 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"
3 target triple = "x86_64-unknown-linux-gnu"
4
5 %0 = type { %struct.anon }
6 %1 = type { %0, %2, [24 x i8] }
7 %2 = type <{ %3, %3 }>
8 %3 = type { %struct.hrtimer_cpu_base*, i32, %struct.rb_root, %struct.rb_node*, %struct.pgprot, i64 ()*, [16 x i8] }
9 %struct.anon = type { }
10 %struct.hrtimer_clock_base = type { %struct.hrtimer_cpu_base*, i32, %struct.rb_root, %struct.rb_node*, %struct.pgprot, i64 ()*, %struct.pgprot, %struct.pgprot }
11 %struct.hrtimer_cpu_base = type { %0, [2 x %struct.hrtimer_clock_base], %struct.pgprot, i32, i64 }
12 %struct.pgprot = type { i64 }
13 %struct.rb_node = type { i64, %struct.rb_node*, %struct.rb_node* }
14 %struct.rb_root = type { %struct.rb_node* }
15
16 @per_cpu__hrtimer_bases = external global %1, align 8 ; <%1*> [#uses=1]
17
18 define void @init_hrtimers_cpu(i32 %cpu) nounwind noredzone section ".cpuinit.text" {
19 entry:
20 %tmp3 = getelementptr %struct.hrtimer_cpu_base* bitcast (%1* @per_cpu__hrtimer_bases to %struct.hrtimer_cpu_base*), i32 0, i32 0 ; <%0*> [#uses=1]
21 %tmp5 = bitcast %0* %tmp3 to i8* ; [#uses=0]
22 unreachable
23 }