This patch corrects a problem in the compiler whereby the determination of scope levels during the generation of accessibility checks for function calls within range constraints leads to a compiler crash due to the type not being fully analyzed at the point in which its scope depth must be obtained. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Innermost_Master_Scope_Depth): Detect and handle case where scope depth is not set on an enclosing scope.