Hi! On Mon, Jan 15, 2018 at 05:09:06PM -0600, Bill Schmidt wrote: > @@ -12933,9 +12974,27 @@ > "" > { > if (TARGET_32BIT) > - emit_jump_insn (gen_tablejumpsi (operands[0], operands[1])); > + { > + if (rs6000_speculate_indirect_jumps) > + emit_jump_insn (gen_tablejumpsi (operands[0], operands[1])); > + else > + { > + rtx ccreg = gen_reg_rtx (CCmode); > + rtx jump = gen_tablejumpsi_nospec (operands[0], operands[1], ccreg); > + emit_jump_insn (jump); > + } > + } > else > - emit_jump_insn (gen_tablejumpdi (operands[0], operands[1])); > + { > + if (rs6000_speculate_indirect_jumps) > + emit_jump_insn (gen_tablejumpdi (operands[0], operands[1])); > + else > + { > + rtx ccreg = gen_reg_rtx (CCmode); > + rtx jump = gen_tablejumpdi_nospec (operands[0], operands[1], ccreg); > + emit_jump_insn (jump); > + } > + } > DONE; > })
This is easier to read if you swap the "if"s (put the rs6000_speculate_indirect_jumps test on the outside). Okay for trunk with or without such a change. Also okay for the branches after some testing (esp. on other ABIs, it is easy to break those together with -mno-speculate-indirect-branches since no one sane would use that combo on purpose). Thanks! Segher