https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37262
--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> --- (In reply to Martin Sebor from comment #4) > I built the gcc-5-branch on powerpc64-linux and the duplicate instructions > are still there with the second test case compiled at -O2 (see below). > > $ /build/gcc-5.x/gcc/xgcc -B /build/gcc-5.x/gcc -O1 -S -Wall -Wextra That's -O1. Is it actually still there at -O2? For the other case (both bgt and beq), at expand time there is a switch which could just be a single conditional (only case 2 is not the same as default, not empty in this case). This doesn't seem to be powerpc- specific; could you open a new PR for this? Thanks.