From c933b893537f9d73a73ea70c551bdfca363ff5d8 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 14 Nov 2018 09:36:19 -0700 Subject: optabs.c (expand_binop): Pass INT_MODE to operand_subword_force iff the operand is a constant. * optabs.c (expand_binop): Pass INT_MODE to operand_subword_force iff the operand is a constant. * gcc.c-torture/compile/20181114.c: New test. 2018-11-14 Ilya Leoshkevich From-SVN: r266151 --- gcc/optabs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/optabs.c') diff --git a/gcc/optabs.c b/gcc/optabs.c index 6052222..c7d1f22 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1377,12 +1377,14 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, start_sequence (); /* Do the actual arithmetic. */ + enum machine_mode op0_mode = CONSTANT_P (op0) ? int_mode : VOIDmode; + enum machine_mode op1_mode = CONSTANT_P (op1) ? int_mode : VOIDmode; for (i = 0; i < GET_MODE_BITSIZE (int_mode) / BITS_PER_WORD; i++) { rtx target_piece = operand_subword (target, i, 1, int_mode); rtx x = expand_binop (word_mode, binoptab, - operand_subword_force (op0, i, int_mode), - operand_subword_force (op1, i, int_mode), + operand_subword_force (op0, i, op0_mode), + operand_subword_force (op1, i, op1_mode), target_piece, unsignedp, next_methods); if (x == 0) -- cgit v1.1