[Ada] Complete implementation of RM C.6(19) clause
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 11 Dec 2018 11:10:27 +0000 (11:10 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 11 Dec 2018 11:10:27 +0000 (11:10 +0000)
commit504775519d3199ea89400f85a599cb791f736cb7
treeccc7225b608c67e93265f33bc741e4dac5c7e268
parentf3e0577c2a2d3463ec8e05ec187ed7ad4f906159
[Ada] Complete implementation of RM C.6(19) clause

This ensures that the compiler fully implements the C.6(19) clause of
the Ada Reference Manual and gives a warning when the clause does change
the passing mechanism of the affected parameter.

2018-12-11  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* fe.h (Is_Atomic_Object): Declare.
(Is_Volatile_Object): Likewise.
* gcc-interface/trans.c (atomic_or_volatile_copy_required_p):
New.
(Call_to_gnu): Generate a copy for an actual parameter passed by
reference if the conditions set forth by RM C.6(19) are met and
specificially deal with an atomic actual parameter.

gcc/testsuite/

* gnat.dg/atomic11.adb, gnat.dg/atomic11_pkg1.ads,
gnat.dg/atomic11_pkg2.ads: New testcase.

From-SVN: r266993
gcc/ada/ChangeLog
gcc/ada/fe.h
gcc/ada/gcc-interface/trans.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/atomic11.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/atomic11_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/atomic11_pkg2.ads [new file with mode: 0644]