------- Comment #17 from rakdver at gcc dot gnu dot org 2010-06-25 09:12 ------- (In reply to comment #16) > > Now, in the first loop if we decide to unswitch on cond3, it transforms this > > into: > ... > > If cond3 tests some variable that is initialized only if cond1 is false, > > this > > unswitching (besides not being very useful because cond3 is never tested > > when > > cond1 is false in the original program) results in jumps on uninitialized > > values comparison. > > while unswitching on cond3 indeed does not make sense, I don't think it can > result in a jump on uninitialized value comparison. Unswitching only works if > the arguments of the comparison are ssa names whose values are computed > outside > of the loop (it does not do invariant motion by itself). So, the computations > based on uninitialized values would have to be introduced by some other pass > (possibly invariant motion).
unless the arguments of the comparison are completely uninitialized (their values are not defined in the function and are not parameters of the function), of course -- is that the case here? We should avoid unswitching on such conditions (in addition to the proposed patch), since the comparison could be unreachable due to some reason that cannot be detected in compile-time. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43866