This patch fixes an issue whereby the creation of an enumeration within package where Default_Scalar_Storage_Order is in effect may lead to a crash when the attributes Image or Value are applied to objects of said type or the type directly. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-08 Justin Squirek gcc/ada/ * exp_imgv.adb (Build_Enumeration_Image_Tables): Default SSO for the building of image tables. (Expand_Image_Attribute): Minor cleanup. gcc/testsuite/ * gnat.dg/sso16.adb: New testcase.