[Ada] Use type conversion when inlining may trigger a run-time check
authorYannick Moy <moy@adacore.com>
Mon, 21 May 2018 14:51:19 +0000 (14:51 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 21 May 2018 14:51:19 +0000 (14:51 +0000)
commit031936bc50832e0159efbac1157790d07a7bafae
treed4f5043214101efece2071ae78b996acf7a25966
parent7255f3c31130b87e515afec8bf315206b1fb0fa1
[Ada] Use type conversion when inlining may trigger a run-time check

In the frontend inlining used in GNATprove, inlining of a return statement
was using an unchecked type conversion, which could cause a necessary
run-time check on the conversion to be skipped. Now fixed.

There is no impact on compilation.

2018-05-21  Yannick Moy  <moy@adacore.com>

gcc/ada/

* inline.adb (Expand_Inlined_Call.Process_Formals): Use a type
conversion instead of an unchecked type conversion when inlining a
return statement, unless type qualification is required (for character
and string literal) or no check can result from the conversion (for
access types).
* opt.ads: Update comment.

From-SVN: r260458
gcc/ada/ChangeLog
gcc/ada/inline.adb
gcc/ada/opt.ads