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

Reply via email to