]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Improve generated code for initialization of atomics
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:49:32 +0000 (09:49 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:49:32 +0000 (09:49 +0000)
This patch makes the temp for initialization of an atomic variable be
constant.

No change in behavior; no test.

2019-08-20  Bob Duff  <duff@adacore.com>

gcc/ada/

* freeze.adb (Is_Atomic_VFA_Aggregate): Make the temp for
initialization of the atomic variable be constant. This is
cleaner, and might improve efficiency.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274728 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/freeze.adb

index 82dd6a17a25c5cc1ddb36be914de923c05bd71db..7affa92a7f67a56e621ab68eb032a753cc87052b 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-20  Bob Duff  <duff@adacore.com>
+
+       * freeze.adb (Is_Atomic_VFA_Aggregate): Make the temp for
+       initialization of the atomic variable be constant. This is
+       cleaner, and might improve efficiency.
+
 2019-08-20  Eric Botcazou  <ebotcazou@adacore.com>
 
        * repinfo.adb (List_Record_Info): In -gnatR4 mode, set the
index 70f4b9dc0f50c76d2bc35be6417967b89f3f7901..bb17e429020950ae20e16471f9f42e0a2858e24e 100644 (file)
@@ -1771,6 +1771,7 @@ package body Freeze is
       New_N :=
         Make_Object_Declaration (Loc,
           Defining_Identifier => Temp,
+          Constant_Present    => True,
           Object_Definition   => New_Occurrence_Of (Typ, Loc),
           Expression          => Relocate_Node (N));
       Insert_Before (Par, New_N);