[Ada] Refine type in expansion of array equality

Message ID 20211109094602.GA830409@adacore.com
State Committed
Commit b5f17bffea261a5fdd7b9a7bd334f21d528d3cfa
Headers
Series [Ada] Refine type in expansion of array equality |

Commit Message

Pierre-Marie de Rodat Nov. 9, 2021, 9:46 a.m. UTC
  Code cleanup related to expansion of predefined equality for GNATprove;
semantics is unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* exp_ch4.adb (Handle_One_Dimension): Parameter N must be always
	positive, because it is translated into expression of 'First and
	'Last.
  

Patch

diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -1637,7 +1637,7 @@  package body Exp_Ch4 is
       --  for that argument in the corresponding function formal
 
       function Handle_One_Dimension
-        (N     : Int;
+        (N     : Pos;
          Index : Node_Id) return Node_Id;
       --  This procedure returns the following code
       --
@@ -1786,7 +1786,7 @@  package body Exp_Ch4 is
       ---------------------------
 
       function Handle_One_Dimension
-        (N     : Int;
+        (N     : Pos;
          Index : Node_Id) return Node_Id
       is
          Need_Separate_Indexes : constant Boolean :=