aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.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/expmed.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/expmed.c')
-rw-r--r--gcc/expmed.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 92c2938..59f81df 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -624,13 +624,28 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
|| (bitsize % BITS_PER_WORD == 0 && bitnum % BITS_PER_WORD == 0)))
{
/* Use the subreg machinery either to narrow OP0 to the required
- words or to cope with mode punning between equal-sized modes. */
- rtx sub = simplify_gen_subreg (fieldmode, op0, GET_MODE (op0),
- bitnum / BITS_PER_UNIT);
- if (sub)
+ words or to cope with mode punning between equal-sized modes.
+ In the latter case, use subreg on the rhs side, not lhs. */
+ rtx sub;
+
+ if (bitsize == GET_MODE_BITSIZE (GET_MODE (op0)))
{
- emit_move_insn (sub, value);
- return true;
+ sub = simplify_gen_subreg (GET_MODE (op0), value, fieldmode, 0);
+ if (sub)
+ {
+ emit_move_insn (op0, sub);
+ return true;
+ }
+ }
+ else
+ {
+ sub = simplify_gen_subreg (fieldmode, op0, GET_MODE (op0),
+ bitnum / BITS_PER_UNIT);
+ if (sub)
+ {
+ emit_move_insn (sub, value);
+ return true;
+ }
}
}