For historical reasons, the compiler caps the size of large static aggregates that are emitted as static data in the object file. If they exceed the cap, then elaboration code is generated instead, but this is in most cases slower, yields bigger and unoptimizable code with poor run-time performance.
This change bumps the limit by an order of magnitude to account for larger aggregates used in modern software. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-11-09 Eric Botcazou <ebotca...@adacore.com> * exp_aggr.adb (Aggr_Size_OK): Bump base limit from 50000 to 500000.
Index: exp_aggr.adb =================================================================== --- exp_aggr.adb (revision 254579) +++ exp_aggr.adb (revision 254580) @@ -428,7 +428,7 @@ -- Start of processing for Aggr_Size_OK begin - -- The normal aggregate limit is 50000, but we increase this limit to + -- The normal aggregate limit is 500000, but we increase this limit to -- 2**24 (about 16 million) if Restrictions (No_Elaboration_Code) or -- Restrictions (No_Implicit_Loops) is specified, since in either case -- we are at risk of declaring the program illegal because of this @@ -448,7 +448,7 @@ -- Finally, we use a small limit in CodePeer mode where we favor loops -- instead of thousands of single assignments (from large aggregates). - Max_Aggr_Size := 50000; + Max_Aggr_Size := 500000; if CodePeer_Mode then Max_Aggr_Size := 100;