Richard Henderson <r...@redhat.com> writes:
> On 11/20/2012 08:55 AM, Richard Sandiford wrote:
>> but what kind of bitfield memory were we trying to
>> create in the ICE case?  The idea was that "adjust_object" is only ever
>> true for bitfield adjustments.  We should then either be using an
>> integer or field mode whose size is picked up by:
>> 
>>   if (defattrs->size_known_p)
>>     size = defattrs->size;
>> 
>> or a BLKmode whose value is passed in via adjust_bitfield_address_size.
>> It sounds like I missed a case where the latter was needed.
>
> A TFmode field of an unaligned TCmode original.  We do wind up with
> a BLKmode extraction, without the _size passed in.

Gah.  How about this patch, currently bootstrapping on x86_64-linux-gnu
as a sanity check?  The last instance seems glaringly obvious in
hindsight :-(

Richard


gcc/
        * expmed.c (store_bit_field_1): Use adjust_bitfield_address_size
        rather than adjust_bitfield_address to change the mode of a reference.
        (extract_bit_field_1): Likewise.

Index: gcc/expmed.c
===================================================================
--- gcc/expmed.c        2012-11-20 09:55:26.000000000 +0000
+++ gcc/expmed.c        2012-11-20 17:24:09.722871322 +0000
@@ -645,7 +645,7 @@ store_bit_field_1 (rtx str_rtx, unsigned
     if (imode != GET_MODE (op0))
       {
        if (MEM_P (op0))
-         op0 = adjust_bitfield_address (op0, imode, 0);
+         op0 = adjust_bitfield_address_size (op0, imode, 0, MEM_SIZE (op0));
        else
          {
            gcc_assert (imode != BLKmode);
@@ -1380,7 +1380,7 @@ extract_bit_field_1 (rtx str_rtx, unsign
     if (imode != GET_MODE (op0))
       {
        if (MEM_P (op0))
-         op0 = adjust_bitfield_address (op0, imode, 0);
+         op0 = adjust_bitfield_address_size (op0, imode, 0, MEM_SIZE (op0));
        else if (imode != BLKmode)
          {
            op0 = gen_lowpart (imode, op0);
@@ -1403,10 +1403,10 @@ extract_bit_field_1 (rtx str_rtx, unsign
          }
        else
          {
-           rtx mem = assign_stack_temp (GET_MODE (op0),
-                                        GET_MODE_SIZE (GET_MODE (op0)));
+           HOST_WIDE_INT size = GET_MODE_SIZE (GET_MODE (op0));
+           rtx mem = assign_stack_temp (GET_MODE (op0), size);
            emit_move_insn (mem, op0);
-           op0 = adjust_bitfield_address (mem, BLKmode, 0);
+           op0 = adjust_bitfield_address_size (mem, BLKmode, 0, size);
          }
       }
   }

Reply via email to