From: Eric Botcazou Date: Thu, 4 Jun 2020 07:56:02 +0000 (+0200) Subject: [Ada] Do not generate extra copies inside initialization procedures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ae6fec84da802171366537fcd497955d527aa201;p=gcc.git [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. --- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 5bc8bf59fef..41ed7646f15 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)