diff mbox

Fix rtl sharing bug in i?86 stv pass

Message ID 20161130120442.GQ3541@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Nov. 30, 2016, 12:04 p.m. UTC
Hi!

This is another RTL sharing bug, tmp is created through gen_rtx_SUBREG
and so shouldn't be shared by the move insn with the following insn that
uses it.

Bootstrapped/regtested on x86_64-linux and i686-linux
(--enable-checking=yes,rtl,extra), ok for trunk?

2016-11-30  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/i386.c (dimode_scalar_chain::convert_op): Avoid
	sharing the SUBREG rtx between move and following insn.


	Jakub

Comments

Uros Bizjak Nov. 30, 2016, 1:18 p.m. UTC | #1
On Wed, Nov 30, 2016 at 1:04 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> This is another RTL sharing bug, tmp is created through gen_rtx_SUBREG
> and so shouldn't be shared by the move insn with the following insn that
> uses it.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux
> (--enable-checking=yes,rtl,extra), ok for trunk?
>
> 2016-11-30  Jakub Jelinek  <jakub@redhat.com>
>
>         * config/i386/i386.c (dimode_scalar_chain::convert_op): Avoid
>         sharing the SUBREG rtx between move and following insn.

Uh, OK for mainline and backports.

Thanks,
Uros.

> --- gcc/config/i386/i386.c.jj   2016-11-30 10:07:26.000000000 +0100
> +++ gcc/config/i386/i386.c      2016-11-30 11:10:21.009991127 +0100
> @@ -3723,7 +3723,7 @@ dimode_scalar_chain::convert_op (rtx *op
>           emit_insn_before (seq, insn);
>         }
>
> -      emit_insn_before (gen_move_insn (tmp, vec_cst), insn);
> +      emit_insn_before (gen_move_insn (copy_rtx (tmp), vec_cst), insn);
>        *op = tmp;
>      }
>    else
>
>         Jakub
diff mbox

Patch

--- gcc/config/i386/i386.c.jj	2016-11-30 10:07:26.000000000 +0100
+++ gcc/config/i386/i386.c	2016-11-30 11:10:21.009991127 +0100
@@ -3723,7 +3723,7 @@  dimode_scalar_chain::convert_op (rtx *op
 	  emit_insn_before (seq, insn);
 	}
 
-      emit_insn_before (gen_move_insn (tmp, vec_cst), insn);
+      emit_insn_before (gen_move_insn (copy_rtx (tmp), vec_cst), insn);
       *op = tmp;
     }
   else