This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++0x] contiguous bitfields race implementation



struct
{
     unsigned int a : 4;
     unsigned char b;
     unsigned int c: 6;
} var;


Well, the kernel guys would like to be able to be able to preserve the
padding bits too.  It's a long long sad story that I won't repeat...
And I don't think we should further complicate this stuff with the
desire to not clobber padding bits :-)  Though be aware the request
might come one day....

Woah, let me see if I got this right. If we were to store in VAR.C above, the default for this memory model would be NOT to clobber the padding bits past <c>? That definitely makes my implementation simpler, so I won't complain, but that's just weird.


Tested on x86-64 both with and without "--param
allow-store-data-races=0", and visually inspecting the assembly on
arm-linux and ia64-linux.
Any way to add a test to the testsuite?

Arghhh... I was afraid you'd ask for one. It was much easier with the test harness on cxx-memory-model. I'll whip one up though...


Aldy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]