On Thu, Oct 31, 2013 at 1:46 AM, Sandra Loosemore
<san...@codesourcery.com> wrote:
> On 10/29/2013 02:51 AM, Bernd Edlinger wrote:
>>
>>
>> On Mon, 28 Oct 2013 21:29:24, Sandra Loosemore wrote:
>>>
>>> On 10/28/2013 03:20 AM, Bernd Edlinger wrote:
>>>>
>>>> I have attached an update to your patch, that should
>>>> a) fix the recursion problem.
>>>> b) restrict the -fstrict-volatile-bitfields to not violate the C++
>>>> memory model.
>
>
> Here's a new version of the update patch.
>
>
>>> Alternatively, if strict_volatile_bitfield_p returns false but
>>> flag_strict_volatile_bitfields> 0, then always force to word_mode and
>>> change the -fstrict-volatile-bitfields documentation to indicate that's
>>> the fallback if the insertion/extraction cannot be done in the declared
>>> mode, rather than claiming that it tries to do the same thing as if
>>> -fstrict-volatile-bitfields were not enabled at all.
>
>
> I decided that this approach was more expedient, after all.
>
> I've tested this patch (in conjunction with my already-approved but
> not-yet-applied patch) on mainline for arm-none-eabi, x86_64-linux-gnu, and
> mips-linux gnu.  I also backported the entire series to GCC 4.8 and tested
> there on arm-none-eabi and x86_64-linux-gnu.  OK to apply?

Hm, I can't seem to find the context for

@@ -923,6 +935,14 @@
        store_fixed_bit_field (str_rtx, bitsize, bitnum, 0, 0, value);
       return;
     }
+  else if (MEM_P (str_rtx)
+          && MEM_VOLATILE_P (str_rtx)
+          && flag_strict_volatile_bitfields > 0)
+    /* This is a case where -fstrict-volatile-bitfields doesn't apply
+       because we can't do a single access in the declared mode of the field.
+       Since the incoming STR_RTX has already been adjusted to that mode,
+       fall back to word mode for subsequent logic.  */
+    str_rtx = adjust_address (str_rtx, word_mode, 0);

   /* Under the C++0x memory model, we must not touch bits outside the
      bit region.  Adjust the address to start at the beginning of the

and the other similar hunk.  I suppose they apply to earlier patches
in the series?  I suppose the above applies to store_bit_field (diff -p
really helps!).  Why would using word_mode be any good as
fallback?  That is, why is "Since the incoming STR_RTX has already
been adjusted to that mode" not the thing to fix?

Richard.

> -Sandra

Reply via email to