Consider the following piece of code:
public void check(Object1 obj1)
Object2 tmp = (Object2)obj1;
If applying the "code/removal/advanced" optimization, Proguard is removing the cast operation.
In my test case, the cast is failing and an exception is thrown : but after optimization, no more cast is done (and then no more exception is thrown) which leads to a bug at runtime.
In SideEffectInstructionChecker.visitConstantInstruction(), shouldn't we had CHECKCAST instruction to notify a side effect : if doing this, the cast operation of my example is no more removed.