Patchwork Continue strict-volatile-bitfields fixes

login
register
mail settings
Submitter Ye Joey
Date Dec. 21, 2011, 3:55 a.m.
Message ID <CAL0py25ThJConFomGS-RajDLTY8Bphz=NMui=qDw-cBp5pRTiA@mail.gmail.com>
Download mbox | patch
Permalink /patch/132582/
State New
Headers show

Comments

Ye Joey - Dec. 21, 2011, 3:55 a.m.
On Wed, Dec 21, 2011 at 12:46 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> On 11/29/11 17:35, Mitchell, Mark wrote:
>>>> So, I still think this patch is the best way to go forward, and it
>>> does
>>>> fix incorrect code generation. Would appreciate an OK.
>>>
>>> Ping.
>>
>> If you don't hear any objections within a week, please proceed.
>
> Committed now after bootstrapping i686-linux and retesting arm-linux
> (some timeout permutations in libstdc++, expected with my qemu setup).
>
>
> Bernd
Noticed a typo in toplev.c:
s/fstrict-volatile-bitfield/fstrict-volatile-bitfields/

Also I'd like to add following target independent test case

        Joey Ye  <joey.ye@arm.com>
       * gcc.dg/volatile-bitfields-2.c: New test.

Patch

--- gcc/testsuite/gcc.dg/volatile-bitfields-2.c	(revision 0)
+++ gcc/testsuite/gcc.dg/volatile-bitfields-2.c	(revision 0)
@@ -0,0 +1,15 @@ 
+/* { dg-do run } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort(void);
+struct thing {
+  volatile unsigned short a: 8;
+  volatile unsigned short b: 8;
+} t = {1,2};
+
+int main()
+{
+  t.a = 3;
+  if (t.a !=3 || t.b !=2) abort();
+  return 0;
+}