diff mbox

[rtl] : Do not generate insns with mismatched REG_EQUAL mode for multiword MULT RTXes.

Message ID 1281007043.26270.1.camel@localhost
State New
Headers show

Commit Message

Uros Bizjak Aug. 5, 2010, 11:17 a.m. UTC
On Thu, 2010-08-05 at 10:46 +0200, Uros Bizjak wrote:

> 2010-08-04  Uros Bizjak  <ubizjak@gmail.com>
> 
> 	* expmed.c (expand_mult_const) <case alg_shift:>: Expand shift into
> 	temporary. Emit move from temporary to accum, so REG_EQUAL note will
> 	be attached to this insn in correct mode.
> 
> This patch fixes original ivopts failure as well.
> 
> Patch is currently regression testing on x86_64-pc-linux-gnu. OK for
> mainline and release branches, if it passes testing?
> 

Regression tests passed OK.

Also, I have added a comment to the patch, see attached.

Uros.

Comments

Bernd Schmidt Aug. 5, 2010, 11:23 a.m. UTC | #1
On 08/05/2010 01:17 PM, Uros Bizjak wrote:
> Index: expmed.c
> ===================================================================
> --- expmed.c	(revision 162899)
> +++ expmed.c	(working copy)
> @@ -2904,9 +2904,11 @@ expand_mult_const (enum machine_mode mod
>        switch (alg->op[opno])
>  	{
>  	case alg_shift:
> -	  accum = expand_shift (LSHIFT_EXPR, mode, accum,
> -				build_int_cst (NULL_TREE, log),
> -				NULL_RTX, 0);
> +	  tem = expand_shift (LSHIFT_EXPR, mode, accum,
> +			      build_int_cst (NULL_TREE, log),
> +			      NULL_RTX, 0);
> +	  /* REG_EQUAL note will be attached to the following insn.  */
> +	  emit_move_insn (accum, tem);
>  	  val_so_far <<= log;
>  	  break;

Ok.


Bernd
diff mbox

Patch

Index: expmed.c
===================================================================
--- expmed.c	(revision 162899)
+++ expmed.c	(working copy)
@@ -2904,9 +2904,11 @@  expand_mult_const (enum machine_mode mod
       switch (alg->op[opno])
 	{
 	case alg_shift:
-	  accum = expand_shift (LSHIFT_EXPR, mode, accum,
-				build_int_cst (NULL_TREE, log),
-				NULL_RTX, 0);
+	  tem = expand_shift (LSHIFT_EXPR, mode, accum,
+			      build_int_cst (NULL_TREE, log),
+			      NULL_RTX, 0);
+	  /* REG_EQUAL note will be attached to the following insn.  */
+	  emit_move_insn (accum, tem);
 	  val_so_far <<= log;
 	  break;