As part of recent improvements related to discriminant checks, a regression was introduced in complex cases of generics and use of 'Image on an expression partially rewritten as a [raise Constraint_Error] node. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Check_Image_Type): Protect against empty Image_Type.