aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2018-06-11 09:15:03 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-06-11 09:15:03 +0000
commitb516a1a96b625e6b2b1d5c4f6b48573a8481e9ac (patch)
treece9288444c5e4ad6f434fca621b6e46e0122f076 /gcc
parent8c6fc01486ed9d26c80353f581675f735d1e8957 (diff)
downloadgcc-b516a1a96b625e6b2b1d5c4f6b48573a8481e9ac.zip
gcc-b516a1a96b625e6b2b1d5c4f6b48573a8481e9ac.tar.gz
gcc-b516a1a96b625e6b2b1d5c4f6b48573a8481e9ac.tar.bz2
[Ada] Unnesting: improve handling of bounds for formal parameters
2018-06-11 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): Check reference to formal parameter of current procedure, because the bounds of its type may be uplevel references. From-SVN: r261394
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/exp_unst.adb14
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6b883b9..ea2c131 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-11 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_unst.adb (Visit_Node): Check reference to formal parameter of
+ current procedure, because the bounds of its type may be uplevel
+ references.
+
2018-06-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: If this is
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb
index c6d49e0..b38f2b6 100644
--- a/gcc/ada/exp_unst.adb
+++ b/gcc/ada/exp_unst.adb
@@ -999,6 +999,20 @@ package body Exp_Unst is
and then not Is_Static_Type (Ent)
then
Note_Uplevel_Ref (Ent, N, Caller, Callee);
+
+ -- Check the type of a formal parameter of the current
+ -- subprogram, whose formal type may be an uplevel
+ -- reference.
+
+ elsif Is_Formal (Ent)
+ and then Scope (Ent) = Current_Subprogram
+ then
+ declare
+ DT : Boolean := False;
+
+ begin
+ Check_Static_Type (Etype (Ent), Empty, DT);
+ end;
end if;
end if;
end if;