]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Avoid creating temporaries in Universal_Integer for range checks
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 3 Jan 2020 14:31:08 +0000 (15:31 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 3 Jun 2020 10:01:24 +0000 (06:01 -0400)
commitcf9e38295f751336e2ce4bc08fe8bf9f7b3ae898
tree10bb94dca93402f2b533281e289ec8a3bb8dae22
parent5cea137308eb2e3912e052132131c7b7d9e19e63
[Ada] Avoid creating temporaries in Universal_Integer for range checks

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

gcc/ada/

* checks.adb (Is_Single_Attribute_Reference): New predicate.
(Generate_Range_Check): Do not force the evaluation if the
node is a single attribute reference.
* exp_util.adb (Side_Effect_Free_Attribute): New predicate.
(Side_Effect_Free) <N_Attribute_Reference>: Call it.
(Remove_Side_Effects): Remove the side effects of the prefix
for an attribute reference whose prefix is not a name.
gcc/ada/checks.adb
gcc/ada/exp_util.adb