[Ada] Fix internal error on fixed-point divide, multiply and scaling
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 30 Sep 2021 10:50:38 +0000 (12:50 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 11 Oct 2021 13:38:11 +0000 (13:38 +0000)
commitcea83351a2a023a07ba5577cd91b5edcd690299b
tree7d9bdec7801de0dfdbcb69d3c85ece87dfbc560d
parent939b3a2ac672ec5792601ef096049302432d4689
[Ada] Fix internal error on fixed-point divide, multiply and scaling

gcc/ada/

* exp_fixd.adb (Get_Size_For_Value): New function returning a size
suitable for a non-negative integer value.
(Get_Type_For_Size): New function returning a standard type suitable
for a size.
(Build_Divide): Call both functions to compute the result type, but
make sure to pass a non-negative value to the first.
(Build_Multiply): Likewise.
(Do_Multiply_Fixed_Universal): Minor consistency tweak.
(Integer_Literal): Call both functions to compute the type.
gcc/ada/exp_fixd.adb