https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71762
--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject dot org> --- Backporting r217638 to gcc-4.9 fixes the problem too. Allowing propagation of __cond60 and __cond59 comparisons into comparisons of len elides the wrong optimization. --- __cond60_9 = len_8(D) > 1; if (__cond60_9 != 0) goto <bb 6>; else goto <bb 3>; <bb 3>: __cond59_13 = len_8(D) == 1; if (__cond59_13 != 0) goto <bb 4>; else goto <bb 5>; /* ... */ <bb 9>: if (__cond60_9 != 0) goto <bb 12>; else goto <bb 10>; --- Becomes: --- if (len_8(D) > 1) goto <bb 6>; else goto <bb 3>; <bb 3>: if (len_8(D) == 1) goto <bb 4>; else goto <bb 5>; /* ... */ <bb 9>: if (len_8(D) <= 1) goto <bb 10>; else goto <bb 12>; ---