[Ada] Move down call to Narrow_Large_Operation in Expand_N_Op_Multiply
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 3 Nov 2020 16:17:21 +0000 (17:17 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 27 Nov 2020 09:15:49 +0000 (04:15 -0500)
gcc/ada/

* exp_ch4.adb (Expand_N_Op_Multiply): Move down block calling
Narrow_Large_Operation if the type is Universal_Integer.

gcc/ada/exp_ch4.adb

index efdc235aa00abe4c135f383859c366c6b73bc098..07c7d1678a9ff61144a4fa0d84c69a6fd6662abe 100644 (file)
@@ -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