Bug 55441 - ThreadSanitizer: handle bitfields
Summary: ThreadSanitizer: handle bitfields
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: sanitizer (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 07:58 UTC by Dmitry Vyukov
Modified: 2021-12-05 09:52 UTC (History)
8 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Vyukov 2012-11-22 07:58:03 UTC
Currently gcc/tsan.c handles only bitfield accesses that are byte-aligned and has byte-granularity:

+  if (bitpos % (size * BITS_PER_UNIT)
+      || bitsize != size * BITS_PER_UNIT)
+    return false;

It must be fixed to handle all bitfield access by extending access to the whole bitfiled. I.e. an access to an uint64 bitfield touches the whole uint64.
Comment 1 Bernd Edlinger 2015-01-04 23:48:16 UTC
ok, consider it fixed.
Comment 2 Andrew Pinski 2021-12-05 09:52:24 UTC
Fixed by r5-6071-gfe86867f07504 in GCC 5 so closing as fixed.