diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-02-25 18:20:01 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-02-25 18:20:01 +0000 |
| commit | af618171f48e2c571ab47daf1e71ec2d4e4b84bd (patch) | |
| tree | 27e07c5bcf4cdd364ff211202d1949d0fa700719 /llvm/lib | |
| parent | c642e53b8c58ea80b4329a336d50856bfddba4e2 (diff) | |
| download | bcm5719-llvm-af618171f48e2c571ab47daf1e71ec2d4e4b84bd.tar.gz bcm5719-llvm-af618171f48e2c571ab47daf1e71ec2d4e4b84bd.zip | |
Fix PR3667
llvm-svn: 65464
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 62554a5e91f..61ca5de5b86 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -10837,7 +10837,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { // out, perform the transformation. Note, we don't know whether Scale is // signed or not. We'll use unsigned version of division/modulo // operation after making sure Scale doesn't have the sign bit set. - if (Scale && Scale->getSExtValue() >= 0LL && + if (ArrayEltSize && Scale && Scale->getSExtValue() >= 0LL && Scale->getZExtValue() % ArrayEltSize == 0) { Scale = ConstantInt::get(Scale->getType(), Scale->getZExtValue() / ArrayEltSize); |

