diff mbox series

[56/77] Use the more specific type when two modes are known to be equal

Message ID 87fue0emrt.fsf@linaro.org
State New
Headers show
Series Add wrapper classes for machine_modes | expand

Commit Message

Richard Sandiford July 13, 2017, 8:58 a.m. UTC
This patch adjusts a couple of cases in which we had established
that two modes were equal and happened to be using the one with the
more general type instead of the one with the more specific type.

2017-07-13  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* expr.c (expand_expr_real_2): Use word_mode instead of innermode
	when the two are known to be equal.

Comments

Jeff Law Aug. 24, 2017, 4:30 a.m. UTC | #1
On 07/13/2017 02:58 AM, Richard Sandiford wrote:
> This patch adjusts a couple of cases in which we had established

> that two modes were equal and happened to be using the one with the

> more general type instead of the one with the more specific type.

> 

> 2017-07-13  Richard Sandiford  <richard.sandiford@linaro.org>

> 	    Alan Hayward  <alan.hayward@arm.com>

> 	    David Sherwood  <david.sherwood@arm.com>

> 

> gcc/

> 	* expr.c (expand_expr_real_2): Use word_mode instead of innermode

> 	when the two are known to be equal.

OK.
Jeff
diff mbox series

Patch

Index: gcc/expr.c
===================================================================
--- gcc/expr.c	2017-07-13 09:18:47.609081780 +0100
+++ gcc/expr.c	2017-07-13 09:18:48.752992795 +0100
@@ -8671,7 +8671,7 @@  #define REDUCE_BIT_FIELD(expr)	(reduce_b
 		  rtx htem, hipart;
 		  op0 = expand_normal (treeop0);
 		  if (TREE_CODE (treeop1) == INTEGER_CST)
-		    op1 = convert_modes (innermode, mode,
+		    op1 = convert_modes (word_mode, mode,
 					 expand_normal (treeop1),
 					 TYPE_UNSIGNED (TREE_TYPE (treeop1)));
 		  else
@@ -8682,8 +8682,8 @@  #define REDUCE_BIT_FIELD(expr)	(reduce_b
 		    goto widen_mult_const;
 		  temp = expand_binop (mode, other_optab, op0, op1, target,
 				       unsignedp, OPTAB_LIB_WIDEN);
-		  hipart = gen_highpart (innermode, temp);
-		  htem = expand_mult_highpart_adjust (innermode, hipart,
+		  hipart = gen_highpart (word_mode, temp);
+		  htem = expand_mult_highpart_adjust (word_mode, hipart,
 						      op0, op1, hipart,
 						      zextend_p);
 		  if (htem != hipart)