expmed.c (extract_bit_field_1): In the larger-than-a-word case...
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 4 Jun 2013 07:41:18 +0000 (07:41 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 4 Jun 2013 07:41:18 +0000 (07:41 +0000)
* expmed.c (extract_bit_field_1): In the larger-than-a-word case, factor
out the processing order as in store_bit_field_1.

From-SVN: r199637

gcc/ChangeLog
gcc/expmed.c

index f3ef8a074bb72cb5af691d7a3305e99d6fac67a2..cae512a705b9549a11c97976808a4a3eabc16f63 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * expmed.c (extract_bit_field_1): In the larger-than-a-word case, factor
+       out the processing order as in store_bit_field_1.
+
 2013-06-04  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/57500
@@ -33,7 +38,7 @@
 2013-06-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/57268
-       * sched-deps.c (sched_analyze_2): Don't flush_pedning_lists
+       * sched-deps.c (sched_analyze_2): Don't flush_pending_lists
        if DEBUG_INSN_P (insn).
 
        Reapply
index daadd3def5d027980f8c53af3ddf5b034ede2d3d..79f3424961d8d6191bef200f9b99362def695a24 100644 (file)
@@ -1486,6 +1486,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
         This is because the most significant word is the one which may
         be less than full.  */
 
+      unsigned int backwards = WORDS_BIG_ENDIAN;
       unsigned int nwords = (bitsize + (BITS_PER_WORD - 1)) / BITS_PER_WORD;
       unsigned int i;
       rtx last;
@@ -1503,13 +1504,14 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
             if I is 1, use the next to lowest word; and so on.  */
          /* Word number in TARGET to use.  */
          unsigned int wordnum
-           = (WORDS_BIG_ENDIAN
+           = (backwards
               ? GET_MODE_SIZE (GET_MODE (target)) / UNITS_PER_WORD - i - 1
               : i);
          /* Offset from start of field in OP0.  */
-         unsigned int bit_offset = (WORDS_BIG_ENDIAN
-                                    ? MAX (0, ((int) bitsize - ((int) i + 1)
-                                               * (int) BITS_PER_WORD))
+         unsigned int bit_offset = (backwards
+                                    ? MAX ((int) bitsize - ((int) i + 1)
+                                           * BITS_PER_WORD,
+                                           0)
                                     : (int) i * BITS_PER_WORD);
          rtx target_part = operand_subword (target, wordnum, 1, VOIDmode);
          rtx result_part
@@ -1541,7 +1543,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
              for (i = nwords; i < total_words; i++)
                emit_move_insn
                  (operand_subword (target,
-                                   WORDS_BIG_ENDIAN ? total_words - i - 1 : i,
+                                   backwards ? total_words - i - 1 : i,
                                    1, VOIDmode),
                   const0_rtx);
            }