Instrument bit field and unaligned accesses for TSAN.
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 2 Jan 2015 22:16:59 +0000 (22:16 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Fri, 2 Jan 2015 22:16:59 +0000 (22:16 +0000)
commitfe86867f07504f643ab9bf1147bac785222cadb0
tree2e150e026804c390ac9333406e3d7552c6a62711
parente4dd5b691d56f11c225e1e1847be3800854634b6
Instrument bit field and unaligned accesses for TSAN.

gcc/ChangeLog:
2015-01-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Instrument bit field and unaligned accesses for TSAN.
        * sanitizer.def (BUILT_IN_TSAN_READ_RANGE): New built-in function.
        (BUILT_IN_TSAN_WRITE_RANGE): New built-in function.
        * tsan.c (instrument_expr): Handle COMPONENT_REF and BIT_FIELD_REF.
        Use BUILT_IN_TSAN_READ_RANGE and BUILT_IN_TSAN_WRITE_RANGE for
        unaligned memory regions.

testsuite/ChangeLog:
2015-01-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-c++-common/tsan/bitfield_race.c: New testcase.
        * g++.dg/tsan/aligned_vs_unaligned_race.C: Fixed.

From-SVN: r219150
gcc/ChangeLog
gcc/sanitizer.def
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/tsan/bitfield_race.c [new file with mode: 0644]
gcc/testsuite/g++.dg/tsan/aligned_vs_unaligned_race.C
gcc/tsan.c