From: Eric Botcazou Date: Thu, 30 Jan 2020 20:48:27 +0000 (+0100) Subject: [Ada] Add No_Truncation flag on view conversion for GNAT-LLVM X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=efd0843da81aafee053afe573bfa944bbd1ee32b;p=gcc.git [Ada] Add No_Truncation flag on view conversion for GNAT-LLVM 2020-06-05 Eric Botcazou gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) : Set the No_Truncation flag on the unchecked conversion built for scalar types. --- diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 9d697961248..1c9b971e927 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -7185,6 +7185,12 @@ package body Exp_Attr is Unchecked_Convert_To (Val_Typ, New_Copy_Tree (Pref)), Attribute_Name => Name_Valid); + -- Required by LLVM although the sizes are the same??? + + if Nkind (Prefix (Expr)) = N_Unchecked_Type_Conversion then + Set_No_Truncation (Prefix (Expr)); + end if; + -- Validate the scalar components of an array by iterating over all -- dimensions of the array while checking individual components.