From: Eric Botcazou <ebotca...@adacore.com>

The OK_Convert_To function already sets the Etype of its result.

gcc/ada/ChangeLog:

        * exp_imgv.adb (Expand_Value_Attribute): Do not call Set_Etype on N
        after rewriting it by means of OK_Convert_To.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/exp_imgv.adb | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gcc/ada/exp_imgv.adb b/gcc/ada/exp_imgv.adb
index 6c2b940736b..3fef6fabe64 100644
--- a/gcc/ada/exp_imgv.adb
+++ b/gcc/ada/exp_imgv.adb
@@ -1631,7 +1631,6 @@ package body Exp_Imgv is
                Name => New_Occurrence_Of (RTE (Vid), Loc),
                Parameter_Associations => Args)));
 
-         Set_Etype (N, Btyp);
          Analyze_And_Resolve (N, Btyp);
          return;
 
@@ -1675,7 +1674,6 @@ package body Exp_Imgv is
                      Name => New_Occurrence_Of (RTE (Vid), Loc),
                      Parameter_Associations => Args)));
 
-               Set_Etype (N, Btyp);
                Analyze_And_Resolve (N, Btyp);
                return;
             end if;
-- 
2.43.0

Reply via email to