]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Use static allocation for small dynamic string concatenations in more cases
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 19 Jun 2024 20:45:29 +0000 (22:45 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 2 Jul 2024 13:20:35 +0000 (15:20 +0200)
commit4996c5ff650cf1703f0def8665839383e427aba2
tree9464471c274098e4c87ca43c8bc4483408f09679
parent78fe22892c6dc0f4bfd4e7fc0d2d43a9074c209c
ada: Use static allocation for small dynamic string concatenations in more cases

This lifts the limitation of the original implementation whereby the first
operand of the concatenation needs to have a length known at compiled time
in order for the static allocation to be used.

gcc/ada/

* exp_ch4.adb (Expand_Concatenate): In the case where an operand
does not have both bounds known at compile time, use nevertheless
the low bound directly if it is known at compile time.
Fold the conditional expression giving the low bound of the result
in the general case if the low bound of all the operands are equal.
gcc/ada/exp_ch4.adb