From 800da97743ec985d0de0215afcf6bb44b7cd23c8 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 20 Jan 2014 16:13:01 +0100 Subject: [multiple changes] 2014-01-20 Robert Dewar * gnat1drv.adb: Minor comment update. 2014-01-20 Tristan Gingold * raise-gcc.c (PERSONALITY_FUNCTION/arm): Remove unused variables, comment out unused code. * a-exexpr-gcc.adb: Move declarations to s-excmac-gcc.ads * s-excmac-gcc.ads: New file, extracted from a-exexpr-gcc.adb * s-excmac-arm.ads: New file. 2014-01-20 Hristian Kirtchev * exp_ch4.adb (Expand_N_Slice): Remove constant D and variables Drange and Index_Typ. Remove the circuitry which creates a range check to compare the index type of the array against the discrete_range. * sem_res.adb (Resolve_Slice): Add local variable Dexpr. Update the circuitry which creates a range check to handle a discrete_range denoted by a subtype indication. 2014-01-20 Pierre-Marie Derodat * sinput.adb, sinput.ads (Sloc_Range): Traverse the tree of original nodes to get the original sloc range. 2014-01-20 Hristian Kirtchev * sem_prag.adb (Analyze_Pragma): Use Defining_Entity to obtain the entity of a [library level] package. From-SVN: r206817 --- gcc/ada/exp_ch4.adb | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'gcc/ada/exp_ch4.adb') diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index c8cded1..f474060 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -9411,11 +9411,8 @@ package body Exp_Ch4 is -- Local variables - D : constant Node_Id := Discrete_Range (N); - Pref : constant Node_Id := Prefix (N); - Pref_Typ : Entity_Id := Etype (Pref); - Drange : Node_Id; - Index_Typ : Entity_Id; + Pref : constant Node_Id := Prefix (N); + Pref_Typ : Entity_Id := Etype (Pref); -- Start of processing for Expand_N_Slice @@ -9441,41 +9438,6 @@ package body Exp_Ch4 is Make_Build_In_Place_Call_In_Anonymous_Context (Pref); end if; - -- Find the range of the discrete_range. For ranges that do not appear - -- in the slice itself, we make a shallow copy and inherit the source - -- location and the parent field from the discrete_range. This ensures - -- that the range check is inserted relative to the slice and that the - -- runtime exception poins to the proper construct. - - if Nkind (D) = N_Range then - Drange := D; - - elsif Nkind_In (D, N_Expanded_Name, N_Identifier) then - Drange := New_Copy (Scalar_Range (Entity (D))); - Set_Etype (Drange, Entity (D)); - Set_Parent (Drange, Parent (D)); - Set_Sloc (Drange, Sloc (D)); - - else pragma Assert (Nkind (D) = N_Subtype_Indication); - Drange := New_Copy (Range_Expression (Constraint (D))); - Set_Etype (Drange, Etype (D)); - Set_Parent (Drange, Parent (D)); - Set_Sloc (Drange, Sloc (D)); - end if; - - -- Find the type of the array index - - if Ekind (Pref_Typ) = E_String_Literal_Subtype then - Index_Typ := Etype (String_Literal_Low_Bound (Pref_Typ)); - else - Index_Typ := Etype (First_Index (Pref_Typ)); - end if; - - -- Add a runtime check to test the compatibility between the array range - -- and the discrete_range. - - Apply_Range_Check (Drange, Index_Typ); - -- The remaining case to be handled is packed slices. We can leave -- packed slices as they are in the following situations: -- cgit v1.1