diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-27 17:54:37 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-27 17:54:37 +0100 |
commit | 8b4230c823ba1106ebd6bbfcfdea98fc8bbd16d2 (patch) | |
tree | d7021741bf39c55d0e737810af9bddd5a46496fe /gcc/ada/exp_ch4.adb | |
parent | 29077c18417c523c5fd2790613ba4ea2988660c4 (diff) | |
download | gcc-8b4230c823ba1106ebd6bbfcfdea98fc8bbd16d2.zip gcc-8b4230c823ba1106ebd6bbfcfdea98fc8bbd16d2.tar.gz gcc-8b4230c823ba1106ebd6bbfcfdea98fc8bbd16d2.tar.bz2 |
[multiple changes]
2014-01-27 Tristan Gingold <gingold@adacore.com>
* exp_ch7.adb, exp_ch9.adb: Adjust comments.
2014-01-27 Robert Dewar <dewar@adacore.com>
* exp_ch4.adb (Expand_N_Op_Expon): Remove unsigned type test
for 2**X optimization.
2014-01-27 Ed Schonberg <schonberg@adacore.com>
* a-suenst.adb: strings.utf_encoding.strings (Decode): Check
explicitly whether value is in range of Character, because the
library is typically compiled with range checks disabled, and
we cannot rely on the implicit check on the argument of 'Val.
2014-01-27 Vincent Celier <celier@adacore.com>
* a-ciorma.adb, a-cihama.adb (Assign): Copy the Source to the Target,
not the Target to itself.
2014-01-27 Robert Dewar <dewar@adacore.com>
* vms_conv.ads, ali.adb, sem_ch6.ads, opt.ads, vms_cmds.ads: Minor
changes to avoid incorrect use of unordered enum types.
2014-01-27 Thomas Quinot <quinot@adacore.com>
* sem_ch4.adb: Minor reformatting.
From-SVN: r207144
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index d0288b2..6952665 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -7469,12 +7469,16 @@ package body Exp_Ch4 is -- a non-binary modulus in the multiplication case, since we get a wrong -- result if the shift causes an overflow before the modular reduction. + -- Note: we used to check that Exptyp was an unsigned type. But that is + -- an unnecessary check, since if Exp is negative, we have a run-time + -- error that is either caught (so we get the right result) or we have + -- suppressed the check, in which case the code is erroneous anyway. + if Nkind (Base) = N_Integer_Literal and then CRT_Safe_Compile_Time_Known_Value (Base) and then Expr_Value (Base) = Uint_2 and then Is_Integer_Type (Root_Type (Exptyp)) and then Esize (Root_Type (Exptyp)) <= Esize (Standard_Integer) - and then Is_Unsigned_Type (Exptyp) and then not Ovflo then -- First the multiply and divide cases |