https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64700
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 59035 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59035&action=edit Start of the patch This patch extends factor_out_conditional_operation to do more than one operand. We can't do the factoring for division with constants as we don't undo it later on so I disabled for that (PR22196). I have not add any testcases yet. There are a few regressions: +FAIL: gcc.dg/Warray-bounds-92.c (test for warnings, line 106) +FAIL: gcc.dg/Warray-bounds-92.c (test for warnings, line 132) +FAIL: gcc.dg/builtin-object-size-1.c execution test PR 116556 (I think the Warray-bounds are also this one) +FAIL: gcc.dg/tree-ssa/slsr-12.c scan-tree-dump-times optimized " \\\\* " 3 +FAIL: gcc.dg/tree-ssa/slsr-34.c scan-tree-dump-times optimized " \\\\* " 1 +FAIL: gcc.dg/tree-ssa/slsr-8.c scan-tree-dump-times optimized " w?\\\\* " 10 PR 116553 +FAIL: gcc.dg/tree-ssa/split-path-2.c scan-tree-dump split-paths "appears to be a join point for if-convertable diamond" PR 112402 +FAIL: gcc.target/i386/pr113609-1.c scan-assembler-times kortest 17 +FAIL: gcc.target/i386/pr113609-2.c scan-assembler-times [ \\\\t]+je 4 +FAIL: gcc.target/i386/pr113609-2.c scan-assembler-times [ \\\\t]+sete 4 This needs to be looked more into but I think it is just a testcase issue.