aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-01 16:30:34 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-01 16:30:34 +0200
commit0bb9276c88e58a10a6711a49b974bb5e71eb37e7 (patch)
tree4dd72eda6c0336868945cbdd3efd64412ecd91c9 /gcc/ada/sem_ch3.adb
parentee222ce05cf5321a72c7f70e75a5e839c3e0bdaf (diff)
downloadgcc-0bb9276c88e58a10a6711a49b974bb5e71eb37e7.zip
gcc-0bb9276c88e58a10a6711a49b974bb5e71eb37e7.tar.gz
gcc-0bb9276c88e58a10a6711a49b974bb5e71eb37e7.tar.bz2
[multiple changes]
2011-08-01 Eric Botcazou <ebotcazou@adacore.com> * gnat_rm.texi: Document limitation of Pragma No_Strict_Aliasing. 2011-08-01 Tristan Gingold <gingold@adacore.com> * seh_init.c: Fix SEH handler installation on win64. 2011-08-01 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Access_Subprogram_Declaration): in Asis mode, prevent double analysis of an anonymous access to subprogram, because it can lead to improper sharing of profiles and a back-end crash. From-SVN: r177037
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index c686e90..c44b4e7 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -1172,6 +1172,22 @@ package body Sem_Ch3 is
begin
F := First (Formals);
+
+ -- In ASIS mode, the access_to_subprogram may be analyzed twice,
+ -- when it is part of an unconstrained type and subtype expansion
+ -- is disabled. To avoid back-end problems with shared profiles,
+ -- use previous subprogram type as the designated type.
+
+ if ASIS_Mode
+ and then Present (Scope (Defining_Identifier (F)))
+ then
+ Set_Etype (T_Name, T_Name);
+ Init_Size_Align (T_Name);
+ Set_Directly_Designated_Type (T_Name,
+ Scope (Defining_Identifier (F)));
+ return;
+ end if;
+
while Present (F) loop
if No (Parent (Defining_Identifier (F))) then
Set_Parent (Defining_Identifier (F), F);