From efd0843da81aafee053afe573bfa944bbd1ee32b Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 30 Jan 2020 21:48:27 +0100 Subject: [PATCH] [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. --- gcc/ada/exp_attr.adb | 6 ++++++ 1 file changed, 6 insertions(+) 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. -- 2.30.2