nds32: Fix casesi (PR70668)

Expanders do not have more elements in the operands array than declared
in the pattern.  So, we cannot use operands[5] here.  Instead just
declare and use another rtx.


	PR target/70668
	* config/nds32/nds32.md (casesi): Don't access the operands array
	out of bounds.

From-SVN: r235583
This commit is contained in:
Segher Boessenkool 2016-04-28 18:50:41 +02:00 committed by Segher Boessenkool
parent e41ebdf1c8
commit 9759608c89
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2016-04-28 Segher Boessenkool <segher@kernel.crashing.org>
PR target/70668
* config/nds32/nds32.md (casesi): Don't access the operands array
out of bounds.
2016-04-28 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (zeroing peephole2): Use general_reg_operand.

View File

@ -2288,11 +2288,9 @@ create_template:
emit_jump_insn (gen_cbranchsi4 (test, operands[0], operands[2],
operands[4]));
operands[5] = gen_reg_rtx (SImode);
/* Step C, D, E, and F, using another temporary register operands[5]. */
emit_jump_insn (gen_casesi_internal (operands[0],
operands[3],
operands[5]));
/* Step C, D, E, and F, using another temporary register. */
rtx tmp = gen_reg_rtx (SImode);
emit_jump_insn (gen_casesi_internal (operands[0], operands[3], tmp));
DONE;
})