[multiple changes]
[gcc.git] / gcc / ada / exp_util.adb
index 0d1f73c4044ffcd8c8932c1a72eea87b84bfa587..d712570d920edb0207de04fbb590e2fd81713ac4 100644 (file)
@@ -628,9 +628,13 @@ package body Exp_Util is
 
             --  d) Finalize_Address
 
-            Fin_Addr_Id := Find_Finalize_Address (Desig_Typ);
+            --  Primitive Finalize_Address is never generated in CodePeer mode
+            --  since it contains an Unchecked_Conversion.
 
-            if Needs_Finalization (Desig_Typ) then
+            if Needs_Finalization (Desig_Typ)
+              and then not CodePeer_Mode
+            then
+               Fin_Addr_Id := Find_Finalize_Address (Desig_Typ);
                pragma Assert (Present (Fin_Addr_Id));
 
                Append_To (Actuals,