diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-11-03 17:17:21 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-27 04:15:49 -0500 |
commit | bc1304f6a190b9d9883fd24cac3cca9334e848b3 (patch) | |
tree | 0d3bb16a6b5ed22ade582051205741c6c703d584 /gcc | |
parent | 7943c4dbb80efe7a39b896852bb5b79b84bbf8bc (diff) | |
download | gcc-bc1304f6a190b9d9883fd24cac3cca9334e848b3.zip gcc-bc1304f6a190b9d9883fd24cac3cca9334e848b3.tar.gz gcc-bc1304f6a190b9d9883fd24cac3cca9334e848b3.tar.bz2 |
[Ada] Move down call to Narrow_Large_Operation in Expand_N_Op_Multiply
gcc/ada/
* exp_ch4.adb (Expand_N_Op_Multiply): Move down block calling
Narrow_Large_Operation if the type is Universal_Integer.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index efdc235..07c7d16 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -9716,16 +9716,6 @@ package body Exp_Ch4 is end if; end if; - -- Try to narrow the operation - - if Typ = Universal_Integer then - Narrow_Large_Operation (N); - - if Nkind (N) /= N_Op_Multiply then - return; - end if; - end if; - -- Convert x * 2 ** y to Shift_Left (x, y). Note that the fact that -- Is_Power_Of_2_For_Shift is set means that we know that our left -- operand is an integer, as required for this to work. @@ -9802,6 +9792,16 @@ package body Exp_Ch4 is return; end if; + -- Try to narrow the operation + + if Typ = Universal_Integer then + Narrow_Large_Operation (N); + + if Nkind (N) /= N_Op_Multiply then + return; + end if; + end if; + -- Do required fixup of universal fixed operation if Typ = Universal_Fixed then |