aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-01-20 16:13:01 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-20 16:13:01 +0100
commit800da97743ec985d0de0215afcf6bb44b7cd23c8 (patch)
treedf7366eae3b5b18cdc84769c44cb7da59b48e15a /gcc/ada/exp_ch4.adb
parent51b0e05ae4a0c5a4ef37e52f8e1702b02e6d8f72 (diff)
downloadgcc-800da97743ec985d0de0215afcf6bb44b7cd23c8.zip
gcc-800da97743ec985d0de0215afcf6bb44b7cd23c8.tar.gz
gcc-800da97743ec985d0de0215afcf6bb44b7cd23c8.tar.bz2
[multiple changes]
2014-01-20 Robert Dewar <dewar@adacore.com> * gnat1drv.adb: Minor comment update. 2014-01-20 Tristan Gingold <gingold@adacore.com> * 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 <kirtchev@adacore.com> * 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 <derodat@adacore.com> * sinput.adb, sinput.ads (Sloc_Range): Traverse the tree of original nodes to get the original sloc range. 2014-01-20 Hristian Kirtchev <kirtchev@adacore.com> * sem_prag.adb (Analyze_Pragma): Use Defining_Entity to obtain the entity of a [library level] package. From-SVN: r206817
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb42
1 files changed, 2 insertions, 40 deletions
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: