aboutsummaryrefslogtreecommitdiff
path: root/test-driver
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-06-17 19:48:05 +0100
committerJonathan Wakely <jwakely@redhat.com>2020-06-17 20:02:53 +0100
commitd2384b7b24f8557b66f6958a05ea99ff4307e75c (patch)
tree87421899129a396ec7cdf476312dc30ae7cd7f22 /test-driver
parent4e49b994de060d4a6c9318d0ed52ef038153426e (diff)
downloadgcc-d2384b7b24f8557b66f6958a05ea99ff4307e75c.zip
gcc-d2384b7b24f8557b66f6958a05ea99ff4307e75c.tar.gz
gcc-d2384b7b24f8557b66f6958a05ea99ff4307e75c.tar.bz2
c-family: check qualifiers of arguments to __atomic built-ins (PR 95378)
Currently the __atomic_{load,store,exchange,compare_exchange} built-ins will happily store values through pointers to const, or use pointers to volatile as the input and output arguments. This patch ensures that any pointer that will be written through does not point to a const object, and only the pointer to the atomic variable can be volatile. This differs slightly from Clang, which allows the third argument to __atomic_exchange (the one that is used to return the old value) to be volatile if and only if the first argument is volatile. That doesn't seem useful. For C++ emit errors, but for C use pedwarns that are controlled by -Wincompatible-pointer-types. gcc/c-family/ChangeLog: * c-common.c (get_atomic_generic_size): Check cv-qualifiers in pointer arguments. gcc/testsuite/ChangeLog: * c-c++-common/pr95378.c: New test.
Diffstat (limited to 'test-driver')
0 files changed, 0 insertions, 0 deletions