[Ada] Do not generate useless length check for array initialization
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 15 Apr 2020 19:11:17 +0000 (21:11 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 17 Jun 2020 08:14:16 +0000 (04:14 -0400)
commit25f11dfe76f537afd72380a698eba3a98a9f694a
treecf9cfcb7aa666bb999b9c1088413a33efe81af66
parentcf9087af1f963e52ed4f0d3b8594e2214bd7b312
[Ada] Do not generate useless length check for array initialization

2020-06-17  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* checks.ads (Apply_Length_Check_On_Assignment): Declare.
* checks.adb (Apply_Length_Check_On_Assignment): New procedure
to apply a length check to an expression in an assignment.
* exp_ch5.adb (Expand_Assign_Array): Call it instead of calling
Apply_Length_Check to generate a length check.
* sem_ch5.adb (Analyze_Assignment): Likewise.
gcc/ada/checks.adb
gcc/ada/checks.ads
gcc/ada/exp_ch5.adb
gcc/ada/sem_ch5.adb