summaryrefslogtreecommitdiff
path: root/gcc/dse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dse.c')
-rw-r--r--gcc/dse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/dse.c b/gcc/dse.c
index 9dab6259c17..9d19b7071ee 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1446,7 +1446,7 @@ find_shift_sequence (int access_size,
new_mode = GET_MODE_WIDER_MODE (new_mode))
{
rtx target, new_reg, shift_seq, insn, new_lhs;
- int cost;
+ int cost, offset;
/* Try a wider mode if truncating the store mode to NEW_MODE
requires a real instruction. */
@@ -1460,8 +1460,9 @@ find_shift_sequence (int access_size,
if (!CONSTANT_P (store_info->rhs)
&& !MODES_TIEABLE_P (new_mode, store_mode))
continue;
+ offset = subreg_lowpart_offset (new_mode, store_mode);
new_lhs = simplify_gen_subreg (new_mode, copy_rtx (store_info->rhs),
- store_mode, 0);
+ store_mode, offset);
if (new_lhs == NULL_RTX)
continue;