C: Fix atomic loads. [PR97981]
authorMartin Uecker <muecker@gwdg.de>
Mon, 7 Dec 2020 22:51:25 +0000 (23:51 +0100)
committerMartin Uecker <muecker@gwdg.de>
Mon, 7 Dec 2020 22:57:43 +0000 (23:57 +0100)
commita19a242c708060e067b4fd5a76995144e6f239d0
tree2656bc2992da8a4b9aba84a5ea09b35818e51f3b
parentb737b70fad398728f6006e8397d1bb31ccea4ce7
C: Fix atomic loads. [PR97981]

To handle atomic loads correctly, we need to move the code that
drops qualifiers in lvalue conversion after the code that
handles atomics.

2020-12-07  Martin Uecker  <muecker@gwdg.de>

gcc/c/
PR c/97981
* c-typeck.c (convert_lvalue_to_rvalue): Move the code
that drops qualifiers to the end of the function.

gcc/testsuite/
PR c/97981
* gcc.dg/pr97981.c: New test.
* gcc.dg/pr60195.c: Adapt test.
gcc/c/c-typeck.c
gcc/testsuite/gcc.dg/pr60195.c
gcc/testsuite/gcc.dg/pr97981.c [new file with mode: 0644]