This is the mail archive of the
mailing list for the GCC project.
[cxx-mem-model] test invalid bitfield twiddling
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 21 Mar 2011 11:55:55 -0500
- Subject: [cxx-mem-model] test invalid bitfield twiddling
This test is inspired by PR 48124.
[Jakub, let me know if you find any additional variations on this theme.]
In the C++ memory model, non contiguous bitfields are distinct memory
locations and cannot be accessed by and/or magic if we introduce data races.
In the test below, we can trigger invalid bit twiddling by declaring a
bit field as volatile and then accessing it. On x86-64, we end up using
a 32-bit access which ends up touching the rest of the fields.
Unfortunately, I can't come up with a suitable test without the
volatile-- I guess that's a good thing (either that, or my bit twiddle
skills are lacking).
Committing to branch.
p.s. Oh yeah, I found some small buglets in the harness which are fixed
Description: Text document