aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2014-11-13 14:13:53 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2014-11-13 14:13:53 +0000
commit6fad471b8f1a62c385624bf4cecbd57c397bbe91 (patch)
tree7102d4ae066e562a2a933a3a418af9a8bc29187f /gcc/optabs.c
parentd64ae6140f40859c0e73df7ca597cdf08eb31bd2 (diff)
downloadgcc-6fad471b8f1a62c385624bf4cecbd57c397bbe91.zip
gcc-6fad471b8f1a62c385624bf4cecbd57c397bbe91.tar.gz
gcc-6fad471b8f1a62c385624bf4cecbd57c397bbe91.tar.bz2
optabs.c (prepare_operand): Gracefully fail if the mode of X does not match the operand mode expected by...
* optabs.c (prepare_operand): Gracefully fail if the mode of X does not match the operand mode expected by the insn pattern. From-SVN: r217501
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 6278d7d..3376f2d 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -4308,9 +4308,12 @@ prepare_operand (enum insn_code icode, rtx x, int opnum, machine_mode mode,
if (!insn_operand_matches (icode, opnum, x))
{
+ machine_mode op_mode = insn_data[(int) icode].operand[opnum].mode;
if (reload_completed)
return NULL_RTX;
- x = copy_to_mode_reg (insn_data[(int) icode].operand[opnum].mode, x);
+ if (GET_MODE (x) != op_mode && GET_MODE (x) != VOIDmode)
+ return NULL_RTX;
+ x = copy_to_mode_reg (op_mode, x);
}
return x;