This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Improve generated code for initialization of atomics
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Bob Duff <duff at adacore dot com>
- Date: Tue, 20 Aug 2019 05:51:24 -0400
- Subject: [Ada] Improve generated code for initialization of atomics
This patch makes the temp for initialization of an atomic variable be
constant.
No change in behavior; no test.
Tested on x86_64-pc-linux-gnu, committed on trunk
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.
--- gcc/ada/freeze.adb
+++ gcc/ada/freeze.adb
@@ -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);