diff options
author | Bob Duff <duff@adacore.com> | 2023-01-06 13:23:36 -0500 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-15 11:36:41 +0200 |
commit | 4b7373ea32eb6c129cc9af660945409612861b07 (patch) | |
tree | 9a20711b7fd6e5b7d2f121ffd01e5e21ddfaa443 /libgcc | |
parent | b4509d1960165b205425c5b14ef1ff4ea5fd4435 (diff) | |
download | gcc-4b7373ea32eb6c129cc9af660945409612861b07.zip gcc-4b7373ea32eb6c129cc9af660945409612861b07.tar.gz gcc-4b7373ea32eb6c129cc9af660945409612861b07.tar.bz2 |
ada: Optimize 2**N to avoid explicit 'if' in modular case
The compiler usually turns 2**N into Shift_Left(1,N).
This patch removes the check for "shift amount too big" in the
modular case, because Shift_Left works properly in that case
(i.e. if N is very large, it returns 0).
This removes a redundant check on most hardware; Shift_Left
takes care of large shirt amounts as necessary, even though
most hardware does not.
gcc/ada/
* exp_ch4.adb
(Expand_N_Op_Expon): Remove the too-big check. Simplify. Signed
and modular cases are combined, etc. Remove code with comment "We
only handle cases where the right type is a[sic] integer", because
the right operand must always be an integer at this point.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions