[Ada] Fix failing assertions related to volatile objects
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 26 May 2020 10:19:01 +0000 (12:19 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 10 Jul 2020 09:16:16 +0000 (05:16 -0400)
commiteb6eb3b79aac8efe003861859e52d8e1680b120f
tree7d8338c0b72ca586a49ee6d69cc3be717261d5c9
parentc24633fbbb88d0032008ab012e2e3204b9405ec4
[Ada] Fix failing assertions related to volatile objects

gcc/ada/

* sem_ch3.adb (Process_Discriminants): Set Ekind of the
processed discriminant entity before passing to
Is_Effectively_Volatile, which was crashing on a failed
assertion.
* sem_prag.adb (Analyze_External_Property_In_Decl_Part): Prevent
call to No_Caching_Enabled with entities other than variables,
which was crashing on a failed assertion.
(Analyze_Pragma): Style cleanups.
* sem_util.adb (Is_Effectively_Volatile): Enforce comment with
an assertion; prevent call to No_Caching_Enabled with entities
other than variables.
(Is_Effectively_Volatile_Object): Only call
Is_Effectively_Volatile on objects, not on types.
(No_Caching_Enabled): Enforce comment with an assertion.
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_util.adb