aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-10-31 20:06:49 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-10-31 20:06:49 +0100
commitd8c84975e697eea2e306f80cdb21292331fd69d7 (patch)
tree7ea25de19c8a02724d9cc355bb4b34e90e4f4b93 /gcc/optabs.c
parent5a9785fb4c3ceb3b338634f2ea17474eaebb4955 (diff)
downloadgcc-d8c84975e697eea2e306f80cdb21292331fd69d7.zip
gcc-d8c84975e697eea2e306f80cdb21292331fd69d7.tar.gz
gcc-d8c84975e697eea2e306f80cdb21292331fd69d7.tar.bz2
optabs.c (expand_vec_perm): Avoid vector mode punning SUBREGs in SET_DEST.
* optabs.c (expand_vec_perm): Avoid vector mode punning SUBREGs in SET_DEST. * expmed.c (store_bit_field_1): Likewise. * config/i386/sse.md (movdi_to_sse, vec_pack_sfix_trunc_v2df, vec_pack_sfix_v2df, vec_shl_<mode>, vec_shr_<mode>, vec_interleave_high<mode>, vec_interleave_low<mode>): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign, ix86_expand_sse_movcc, ix86_expand_int_vcond, ix86_expand_vec_perm, ix86_expand_sse_unpack, ix86_expand_args_builtin, ix86_expand_vector_init_duplicate, ix86_expand_vector_set, emit_reduc_half, expand_vec_perm_blend, expand_vec_perm_pshufb, expand_vec_perm_interleave2, expand_vec_perm_pshufb2, expand_vec_perm_vpshufb2_vpermq, expand_vec_perm_vpshufb2_vpermq_even_odd, expand_vec_perm_even_odd_1, expand_vec_perm_broadcast_1, expand_vec_perm_vpshufb4_vpermq2, ix86_expand_sse2_mulv4si3, ix86_expand_pinsr): Likewise. (expand_vec_perm_palignr): Likewise. Modify a copy of *d rather than *d itself. From-SVN: r204274
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index a8a7e4f..3755670 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6624,8 +6624,8 @@ expand_vec_perm (enum machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target)
icode = direct_optab_handler (vec_perm_const_optab, qimode);
if (icode != CODE_FOR_nothing)
{
- tmp = expand_vec_perm_1 (icode, gen_lowpart (qimode, target),
- gen_lowpart (qimode, v0),
+ tmp = mode != qimode ? gen_reg_rtx (qimode) : target;
+ tmp = expand_vec_perm_1 (icode, tmp, gen_lowpart (qimode, v0),
gen_lowpart (qimode, v1), sel_qi);
if (tmp)
return gen_lowpart (mode, tmp);
@@ -6674,7 +6674,7 @@ expand_vec_perm (enum machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target)
}
tmp = gen_rtx_CONST_VECTOR (qimode, vec);
sel = gen_lowpart (qimode, sel);
- sel = expand_vec_perm (qimode, sel, sel, tmp, NULL);
+ sel = expand_vec_perm (qimode, gen_reg_rtx (qimode), sel, tmp, NULL);
gcc_assert (sel != NULL);
/* Add the byte offset to each byte element. */
@@ -6689,8 +6689,8 @@ expand_vec_perm (enum machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target)
gcc_assert (sel_qi != NULL);
}
- tmp = expand_vec_perm_1 (icode, gen_lowpart (qimode, target),
- gen_lowpart (qimode, v0),
+ tmp = mode != qimode ? gen_reg_rtx (qimode) : target;
+ tmp = expand_vec_perm_1 (icode, tmp, gen_lowpart (qimode, v0),
gen_lowpart (qimode, v1), sel_qi);
if (tmp)
tmp = gen_lowpart (mode, tmp);