diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-05-29 18:18:20 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-04 07:45:58 +0000 |
commit | a521dc37999bed5ec1f529b4c6ba7ded09dca464 (patch) | |
tree | 88955b877c7effb7e9b767fdf1d2525fe8ff585b /gcc/gimple-loop-jam.cc | |
parent | 0896e2b79a3f7864b08f221a157a5c7fe8958116 (diff) | |
download | gcc-a521dc37999bed5ec1f529b4c6ba7ded09dca464.zip gcc-a521dc37999bed5ec1f529b4c6ba7ded09dca464.tar.gz gcc-a521dc37999bed5ec1f529b4c6ba7ded09dca464.tar.bz2 |
[Ada] Use static stack allocation for small string if-expressions
This changes the expanded code generated for if-expressions of 1-dimensional
arrays to create a static temporary on the stack if a small upper bound can
be computed for the length of a subtype covering the result. Static stack
allocation is preferred over dynamic allocation for code generation purpose.
This also contains a couple of enhancements to the support code for checks,
so as to avoid generating useless checks during the modified expansion.
gcc/ada/
* checks.adb (Apply_Length_Check_On_Assignment): Return early if
the Suppress_Assignment_Checks flag is set.
(Selected_Range_Checks): Deal with conditional expressions.
* exp_ch4.adb (Too_Large_Length_For_Array): New constant.
(Expand_Concatenate): Use it in lieu of Too_Large_Max_Length.
(Expand_N_If_Expression): If the result has a unidimensional array
type but the dependent expressions have constrained subtypes with
known bounds, create a static temporary on the stack with a subtype
covering the result.
(Get_First_Index_Bounds): Deal with string literals.
* uintp.ads (Uint_256): New deferred constant.
* sinfo.ads (Suppress_Assignment_Checks): Document new usage.
Diffstat (limited to 'gcc/gimple-loop-jam.cc')
0 files changed, 0 insertions, 0 deletions