diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-25 11:34:11 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-25 11:34:11 +0000 |
commit | 463e3bf7411a244b3889f053c71b924841083fdd (patch) | |
tree | 3f696f0ff6c9196d8903fb35f20fb615915ea88d /gcc/expr.c | |
parent | 5b024ad0547ced95efa95ca16591aea111dd12f4 (diff) | |
download | gcc-463e3bf7411a244b3889f053c71b924841083fdd.tar.gz |
PR target/6043
* expr.c (emit_group_store): Handle storing into CONCAT.
* g++.dg/opt/conj2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51311 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 3913ebd76a0..e6821d5f28f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -2113,6 +2113,7 @@ emit_group_store (orig_dst, src, ssize) HOST_WIDE_INT bytepos = INTVAL (XEXP (XVECEXP (src, 0, i), 1)); enum machine_mode mode = GET_MODE (tmps[i]); unsigned int bytelen = GET_MODE_SIZE (mode); + rtx dest = dst; /* Handle trailing fragments that run over the size of the struct. */ if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize) @@ -2126,14 +2127,27 @@ emit_group_store (orig_dst, src, ssize) bytelen = ssize - bytepos; } + if (GET_CODE (dst) == CONCAT) + { + if (bytepos + bytelen <= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)))) + dest = XEXP (dst, 0); + else if (bytepos >= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)))) + { + bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0))); + dest = XEXP (dst, 1); + } + else + abort (); + } + /* Optimize the access just a bit. */ - if (GET_CODE (dst) == MEM - && MEM_ALIGN (dst) >= GET_MODE_ALIGNMENT (mode) + if (GET_CODE (dest) == MEM + && MEM_ALIGN (dest) >= GET_MODE_ALIGNMENT (mode) && bytepos * BITS_PER_UNIT % GET_MODE_ALIGNMENT (mode) == 0 && bytelen == GET_MODE_SIZE (mode)) - emit_move_insn (adjust_address (dst, mode, bytepos), tmps[i]); + emit_move_insn (adjust_address (dest, mode, bytepos), tmps[i]); else - store_bit_field (dst, bytelen * BITS_PER_UNIT, bytepos * BITS_PER_UNIT, + store_bit_field (dest, bytelen * BITS_PER_UNIT, bytepos * BITS_PER_UNIT, mode, tmps[i], ssize); } |