This prevents the generation of the new perfect hash function for the Value attribute of local enumeration types when the target still uses trampolines to implement pointers to local subprograms. The generation of trampolines would be unexpected in these circumstances and maybe even forbidden by the No_Implicit_Dynamic_Code restriction. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_imgv.adb: Add with/use clauses for Targparm. (Build_Enumeration_Image_Tables): Set type of Threshold to Nat and initialize it to Nat'Last if the type is local and the target does not support descriptors. Adjust Threshold_For_Size similarly. (Expand_Value_Attribute): Minor tweaks.