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

Richard Sandiford richard.sandiford@arm.com
Fri Dec 9 13:33:00 GMT 2016


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.

gcc/
2016-11-24  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

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

diff --git a/gcc/expr.c b/gcc/expr.c
index 465326c..0d50bd0 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8666,7 +8666,7 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
 		  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
@@ -8677,8 +8677,8 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
 		    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)



More information about the Gcc-patches mailing list