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]

[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 below.

Attachment: curr
Description: Text document


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