Recent improvements to sem_eval.adb (Fold_Shift) do not take into
account that these operations should be performed on the base type.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_eval.adb (Fold_Shift): Compute values using the base type.
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -4785,7 +4785,7 @@ package body Sem_Eval is
       Static     : Boolean := False;
       Check_Elab : Boolean := False)
    is
-      Typ : constant Entity_Id := Etype (Left);
+      Typ : constant Entity_Id := Base_Type (Etype (Left));
 
       procedure Check_Elab_Call;
       --  Add checks related to calls in elaboration code


Reply via email to