Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-12-02 Thread Eric Botcazou
> Good question. Most of the time the expansion can not know if it expands > Ada, C, or Fortran. In this case we know it can only be Ada, so the C++ > memory model is not mandatory. Maybe Eric can tell, if a data store race > condition may be an issue in Ada if structure is laid out like > __attri

RE: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-12-02 Thread Bernd Edlinger
Hi, On Mon, 2 Dec 2013 15:55:08Richard Biener wrote: > > On Mon, Nov 25, 2013 at 1:07 PM, Bernd Edlinger > wrote: >> Hello, >> >> I had forgotten to run the Ada test suite when I submitted the previous >> version of this patch. >> And indeed there were some Ada test cases failing because in Ada

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-12-02 Thread Richard Biener
On Mon, Nov 25, 2013 at 1:07 PM, Bernd Edlinger wrote: > Hello, > > I had forgotten to run the Ada test suite when I submitted the previous > version of this patch. > And indeed there were some Ada test cases failing because in Ada packed > structures are > like bit fields, but without the DECL_

RE: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-25 Thread Bernd Edlinger
Hello, I had forgotten to run the Ada test suite when I submitted the previous version of this patch. And indeed there were some Ada test cases failing because in Ada packed structures are like bit fields, but without the DECL_BIT_FIELD_TYPE attribute. Please find attached the updated version o

RE: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-18 Thread Bernd Edlinger
Hi, On Fri, 15 Nov 2013 13:30:51, Richard Biener wrote: >> That looks like always pretending it is a bit field. >> But it is not a bit field, and bitregion_start=bitregion_end=0 >> means it is an ordinary value. > > I don't think it is supposed to mean that. It's supposed to mean > "the access is

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-15 Thread Richard Biener
On Fri, Nov 15, 2013 at 12:38 PM, Bernd Edlinger wrote: >> >> Err, well. This just means that the generic C++ memory model >> handling isn't complete. We do >> >> if (TREE_CODE (to) == COMPONENT_REF >> && DECL_BIT_FIELD_TYPE (TREE_OPERAND (to, 1))) >> get_bit_range (&bitregion_start, &bitregion_en

RE: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-15 Thread Bernd Edlinger
> > Err, well. This just means that the generic C++ memory model > handling isn't complete. We do > > if (TREE_CODE (to) == COMPONENT_REF > && DECL_BIT_FIELD_TYPE (TREE_OPERAND (to, 1))) > get_bit_range (&bitregion_start, &bitregion_end, to, &bitpos, &offset); > > and thus restrict ourselves to bit

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-15 Thread Richard Biener
On Fri, Nov 15, 2013 at 11:14 AM, Jakub Jelinek wrote: > On Fri, Nov 15, 2013 at 11:12:39AM +0100, Richard Biener wrote: >> Btw, what does the C++ memory model say for >> >> struct { char x; short a; short b; } a __attribute__((packed)); > > Nothing, because packed is outside of the standard? Ok,

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-15 Thread Jakub Jelinek
On Fri, Nov 15, 2013 at 11:12:39AM +0100, Richard Biener wrote: > Btw, what does the C++ memory model say for > > struct { char x; short a; short b; } a __attribute__((packed)); Nothing, because packed is outside of the standard? Jakub

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-15 Thread Richard Biener
On Thu, Oct 31, 2013 at 11:27 AM, Bernd Edlinger wrote: > Hello, > > meanwhile, I have added a test case to that patch. > > Boot-strapped and regression-tested as usual. > > OK for trunk? Err, well. This just means that the generic C++ memory model handling isn't complete. We do if (TREE

[PING] [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-11-14 Thread Bernd Edlinger
Hello, could you please approve this patch: http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02664.html As it looks like, it fixes the problem reported under PR59134, which is the expander enters infinite recursion while it tries to violate the C++ memory model. The memory context has still the st

RE: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-10-31 Thread Bernd Edlinger
Hello, meanwhile, I have added a test case to that patch. Boot-strapped and regression-tested as usual. OK for trunk? Bernd. > Hi, > > On Fri, 25 Oct 2013 11:26:20, Richard Biener wrote: >> >> On Fri, Oct 25, 2013 at 10:40 AM, Bernd Edlinger >> wrote: >>> Hello, >>> >>> this patch fixes the r

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-10-25 Thread Joseph S. Myers
On Fri, 25 Oct 2013, Richard Biener wrote: > Btw, the C++ standard doesn't cover packed or aligned attributes so > we could declare this a non-issue. Any opinion on that? I think the memory model naturally applies to packed structures (i.e., writes to fields in them should not write to any othe

RE: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-10-25 Thread Bernd Edlinger
Hi, On Fri, 25 Oct 2013 11:26:20, Richard Biener wrote: > > On Fri, Oct 25, 2013 at 10:40 AM, Bernd Edlinger > wrote: >> Hello, >> >> this patch fixes the recently discovered data store race on arm-eabi-gcc >> with -fno-strict-volatile-bitfields >> for structures like this: >> >> #define test_ty

Re: [PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-10-25 Thread Richard Biener
On Fri, Oct 25, 2013 at 10:40 AM, Bernd Edlinger wrote: > Hello, > > this patch fixes the recently discovered data store race on arm-eabi-gcc with > -fno-strict-volatile-bitfields > for structures like this: > > #define test_type unsigned short > > typedef struct s{ > unsigned char Prefix[1]; >

[PATCH] Fix C++0x memory model for -fno-strict-volatile-bitfields on ARM

2013-10-25 Thread Bernd Edlinger
Hello, this patch fixes the recently discovered data store race on arm-eabi-gcc with -fno-strict-volatile-bitfields for structures like this: #define test_type unsigned short typedef struct s{  unsigned char Prefix[1];  test_type Type; }__attribute((__packed__,__aligned__(4))) ss; volatile ss