From: Chung-Ju Wu Date: Tue, 10 Jan 2017 04:23:35 +0000 (+0000) Subject: re PR target/70668 (nds32-elf toolchain fails to compile on OSX) X-Git-Tag: releases/gcc-5.5.0~600 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a78b66ccf112b9a9b4ca92b84cd53c506eee2e95;p=thirdparty%2Fgcc.git re PR target/70668 (nds32-elf toolchain fails to compile on OSX) Fix PR70668. Backport from mainline 2016-04-28 Segher Boessenkool PR target/70668 * config/nds32/nds32.md (casesi): Don't access the operands array out of bounds. From-SVN: r244258 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b0c098f3324..13ceb88ddce7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-01-10 Chung-Ju Wu + + Backport from mainline + 2016-04-28 Segher Boessenkool + + PR target/70668 + * config/nds32/nds32.md (casesi): Don't access the operands array + out of bounds. + 2017-01-09 Andreas Tobler Backport from mainline diff --git a/gcc/config/nds32/nds32.md b/gcc/config/nds32/nds32.md index 64823a13a47f..4df5c59c27ba 100644 --- a/gcc/config/nds32/nds32.md +++ b/gcc/config/nds32/nds32.md @@ -2289,11 +2289,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; })