+ // Handle the "be careful" case above: if this is an array/packed
+ // subscript, scan for a subsequent variable array index.
+ if (isa<SequentialType>(BasePtr1Ty)) {
+ const Type *NextTy =
+ cast<SequentialType>(BasePtr1Ty)->getElementType();
+ bool isBadCase = false;
+
+ for (unsigned Idx = FirstConstantOper+1;
+ Idx != MinOperands && isa<SequentialType>(NextTy); ++Idx) {
+ const Value *V1 = GEP1Ops[Idx], *V2 = GEP2Ops[Idx];
+ if (!isa<Constant>(V1) || !isa<Constant>(V2)) {
+ isBadCase = true;
+ break;
+ }
+ NextTy = cast<SequentialType>(NextTy)->getElementType();
+ }
+
+ if (isBadCase) G1OC = 0;
+ }
+