diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index 450d4c36b211..290ae331d37a 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -2585,11 +2585,7 @@ package body Einfo.Utils is
             loop
                Etyp := Etype (T);
 
-               if No (Etyp) then
-                  Check_Error_Detected;
-               end if;
-
-               exit when No (Etyp) or else T = Etyp
+               exit when T = Etyp
                  or else
                    (Is_Private_Type (T) and then Etyp = Full_View (T))
                  or else
