Fix Value::stripPointerCasts and BasicAA to avoid trouble on

code in unreachable blocks, which have have use-def cycles.
This fixes PR7514.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-06-28 21:16:52 +00:00
parent 08baddbc07
commit 50f424c3d0
3 changed files with 54 additions and 10 deletions
@@ -0,0 +1,16 @@
; RUN: opt -aa-eval -disable-output < %s >& /dev/null
; BasicAA shouldn't infinitely recurse on the use-def cycles in
; unreachable code.
define void @func_2() nounwind {
entry:
unreachable
bb:
%t = select i1 undef, i32* %t, i32* undef
%p = select i1 undef, i32* %p, i32* %p
%q = select i1 undef, i32* undef, i32* %p
%a = getelementptr i8* %a, i32 0
unreachable
}