aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-06-04 09:56:02 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-15 09:42:54 -0400
commitae6fec84da802171366537fcd497955d527aa201 (patch)
tree0e281a605fbe1cf29d93bfea4940c23d25f2babf
parentfbaadba2468d29178dbd7cde8089b12129e360dc (diff)
downloadgcc-ae6fec84da802171366537fcd497955d527aa201.zip
gcc-ae6fec84da802171366537fcd497955d527aa201.tar.gz
gcc-ae6fec84da802171366537fcd497955d527aa201.tar.bz2
[Ada] Do not generate extra copies inside initialization procedures
gcc/ada/ * exp_ch6.adb (Requires_Atomic_Or_Volatile_Copy): Return false inside an initialization procedure.
-rw-r--r--gcc/ada/exp_ch6.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 5bc8bf5..41ed764 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -2196,6 +2196,13 @@ package body Exp_Ch6 is
return False;
end if;
+ -- There is no requirement inside initialization procedures and this
+ -- would generate copies for atomic or volatile composite components.
+
+ if Inside_Init_Proc then
+ return False;
+ end if;
+
-- Check for atomicity mismatch
if Is_Atomic_Object (Actual) and then not Is_Atomic (E_Formal)