re PR rtl-optimization/35838 (FAIL: 22_locale/num_get/get/char/16.cc execution test...
authorRichard Sandiford <rsandifo@nildram.co.uk>
Thu, 17 Apr 2008 20:20:13 +0000 (20:20 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 17 Apr 2008 20:20:13 +0000 (20:20 +0000)
gcc/
PR rtl-optimization/35838
* dse.c (find_shift_sequence): Use subreg_lowpart_offset to work
out the byte offset of the first subreg.

From-SVN: r134411

gcc/ChangeLog
gcc/dse.c

index 89983b940d3e809bc97ffed4f8bc791e77484a75..9e5fcfa4f81baf1b0c1009ebb35e82787c1259f5 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-17  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       PR rtl-optimization/35838
+       * dse.c (find_shift_sequence): Use subreg_lowpart_offset to work
+       out the byte offset of the first subreg.
+
 2008-04-17  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (addti3 splitter): Pass arrays of 3 operands
index 9dab6259c171141e260c73245ea04e9053bc4948..9d19b7071eec4bd40929026bc8ec8b03a0c436f5 100644 (file)
--- 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;