aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-30 15:53:38 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-30 15:53:38 +0200
commit63be2a5ab4f84b257cb17d3a8f16bc56ff8927bc (patch)
treeac56f5229e339d6d196cd4be5f5cd789acb95c4d /gcc
parentdd54644b315aa181b563ee78ee5f48ec908632c2 (diff)
downloadgcc-63be2a5ab4f84b257cb17d3a8f16bc56ff8927bc.zip
gcc-63be2a5ab4f84b257cb17d3a8f16bc56ff8927bc.tar.gz
gcc-63be2a5ab4f84b257cb17d3a8f16bc56ff8927bc.tar.bz2
[multiple changes]
2011-08-30 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c, g-socket.ads: Adjust maximum allowed value for field tv_sec in struct timeval. 2011-08-30 Yannick Moy <moy@adacore.com> * exp_ch9.adb, exp_disp.adb, sem_ch9.adb, sem_res.adb: Protect several blocks of code doing full expansion, previously only guarded by Expander_Active, by anding the test that ALFA_Mode is not set 2011-08-30 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Analyze_Return_Type): If the return type is incomplete, add the function to the list of private dependents, for subsequent legality check on Taft amendment types. * sem_ch12.adb (Analyze_Formal_Incomplete_Type): Initialize Private_Dependents, as for other incomplete types. * sem_util.adb (Wrong_Type): Avoid cascaded errors when a Taft-amendment type is used as the return type of a function. From-SVN: r178307
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog21
-rw-r--r--gcc/ada/exp_ch9.adb14
-rw-r--r--gcc/ada/exp_disp.adb1
-rw-r--r--gcc/ada/g-socket.ads4
-rw-r--r--gcc/ada/s-oscons-tmplt.c22
-rw-r--r--gcc/ada/sem_ch12.adb1
-rw-r--r--gcc/ada/sem_ch6.adb11
-rw-r--r--gcc/ada/sem_ch9.adb2
-rw-r--r--gcc/ada/sem_res.adb5
-rw-r--r--gcc/ada/sem_util.adb16
10 files changed, 86 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 91367c8..0ef75da 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,24 @@
+2011-08-30 Thomas Quinot <quinot@adacore.com>
+
+ * s-oscons-tmplt.c, g-socket.ads: Adjust maximum allowed value for
+ field tv_sec in struct timeval.
+
+2011-08-30 Yannick Moy <moy@adacore.com>
+
+ * exp_ch9.adb, exp_disp.adb, sem_ch9.adb, sem_res.adb: Protect several
+ blocks of code doing full expansion, previously only guarded by
+ Expander_Active, by anding the test that ALFA_Mode is not set
+
+2011-08-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Return_Type): If the return type is incomplete,
+ add the function to the list of private dependents, for subsequent
+ legality check on Taft amendment types.
+ * sem_ch12.adb (Analyze_Formal_Incomplete_Type): Initialize
+ Private_Dependents, as for other incomplete types.
+ * sem_util.adb (Wrong_Type): Avoid cascaded errors when a
+ Taft-amendment type is used as the return type of a function.
+
2011-08-30 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Check_Abstract_Overriding): Code cleanup: replace code
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index b30254d..9e5951a 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -4906,13 +4906,9 @@ package body Exp_Ch9 is
Ldecl2 : Node_Id;
begin
- -- In formal verification mode, do not expand tasking constructs
-
- if ALFA_Mode then
- return;
- end if;
-
- if Expander_Active then
+ if Expander_Active
+ and then not ALFA_Mode
+ then
-- If we have no handled statement sequence, we may need to build
-- a dummy sequence consisting of a null statement. This can be
@@ -11599,7 +11595,9 @@ package body Exp_Ch9 is
Error_Msg_CRT ("protected body", N);
return;
- elsif Expander_Active then
+ elsif Expander_Active
+ and then not ALFA_Mode
+ then
-- Associate discriminals with the first subprogram or entry body to
-- be expanded.
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index b77bb0b..b4f4970 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -702,6 +702,7 @@ package body Exp_Disp is
-- of this restriction.
if not Expander_Active
+ or else ALFA_Mode
or else Restriction_Active (No_Dispatching_Calls)
then
return;
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index 69b6aef..c218b92 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2010, AdaCore --
+-- Copyright (C) 2001-2011, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -432,7 +432,7 @@ package GNAT.Sockets is
Immediate : constant Duration := 0.0;
- Timeval_Forever : constant := 2.0 ** (SOSC.SIZEOF_tv_sec * 8 - 1) - 1.0;
+ Timeval_Forever : constant := 1.0 * SOSC.MAX_tv_sec;
Forever : constant Duration :=
Duration'Min (Duration'Last, Timeval_Forever);
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index 4b5b138..fe3b90d 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -7,7 +7,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1219,6 +1219,26 @@ CND(IP_PKTINFO, "Get datagram info")
CND(SIZEOF_tv_sec, "tv_sec")
#define SIZEOF_tv_usec (sizeof tv.tv_usec)
CND(SIZEOF_tv_usec, "tv_usec")
+/*
+
+ -- Maximum allowed value for tv_sec
+*/
+
+/**
+ ** On Solaris and IRIX, field tv_sec in struct timeval has an undocumented
+ ** hard-wired limit of 100 million.
+ ** On IA64 HP-UX the limit is 2**31 - 1.
+ **/
+#if defined (sun) || (defined (__mips) && defined (__sgi))
+# define MAX_tv_sec "100_000_000"
+
+#elif defined (__hpux__)
+# define MAX_tv_sec "16#7fffffff#"
+
+#else
+# define MAX_tv_sec "2 ** (SIZEOF_tv_sec * 8 - 1) - 1"
+#endif
+CNS(MAX_tv_sec, "")
}
/*
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index fbc9aa9..39ba9b9 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -2381,6 +2381,7 @@ package body Sem_Ch12 is
Enter_Name (T);
Set_Ekind (T, E_Incomplete_Type);
Set_Etype (T, T);
+ Set_Private_Dependents (T, New_Elmt_List);
if Tagged_Present (Def) then
Set_Is_Tagged_Type (T);
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 174a7df..a5d6a1a 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1596,6 +1596,17 @@ package body Sem_Ch6 is
Designator, Typ);
end if;
+ -- The type must be completed in the current package. This
+ -- is checked at the end of the package declaraton, when
+ -- Taft amemdment types are identified.
+
+ if Ekind (Scope (Current_Scope)) = E_Package
+ and then
+ In_Private_Part (Scope (Current_Scope))
+ then
+ Append_Elmt (Designator, Private_Dependents (Typ));
+ end if;
+
else
Error_Msg_NE
("invalid use of incomplete type&", Designator, Typ);
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index f5530a9..e267076 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -1280,6 +1280,7 @@ package body Sem_Ch9 is
if Serious_Errors_Detected = 0
and then Expander_Active
+ and then not ALFA_Mode
then
Expand_N_Protected_Type_Declaration (N);
Process_Full_View (N, T, Def_Id);
@@ -2083,6 +2084,7 @@ package body Sem_Ch9 is
if Serious_Errors_Detected = 0
and then Expander_Active
+ and then not ALFA_Mode
then
Expand_N_Task_Type_Declaration (N);
Process_Full_View (N, T, Def_Id);
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 80f31a5..c3d9ec9 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -3443,6 +3443,7 @@ package body Sem_Res is
and then Is_Limited_Record (Etype (F))
and then not Is_Constrained (Etype (F))
and then Expander_Active
+ and then not ALFA_Mode
and then (Is_Controlled (Etype (F)) or else Has_Task (Etype (F)))
then
Establish_Transient_Scope (A, False);
@@ -3458,6 +3459,7 @@ package body Sem_Res is
elsif Nkind (A) = N_Op_Concat
and then Nkind (N) = N_Procedure_Call_Statement
and then Expander_Active
+ and then not ALFA_Mode
and then
not (Is_Intrinsic_Subprogram (Nam)
and then Chars (Nam) = Name_Asm)
@@ -3521,6 +3523,7 @@ package body Sem_Res is
if (Is_Controlled (DDT) or else Has_Task (DDT))
and then Expander_Active
+ and then not ALFA_Mode
then
Establish_Transient_Scope (A, False);
end if;
@@ -5492,6 +5495,7 @@ package body Sem_Res is
null;
elsif Expander_Active
+ and then not ALFA_Mode
and then Is_Type (Etype (Nam))
and then Requires_Transient_Scope (Etype (Nam))
and then
@@ -6613,6 +6617,7 @@ package body Sem_Res is
-- case we must trigger the transient scope mechanism.
elsif Expander_Active
+ and then not ALFA_Mode
and then Requires_Transient_Scope (Etype (Nam))
then
Establish_Transient_Scope (N, Sec_Stack => True);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index ffca0d2..5306ec6 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -13096,6 +13096,22 @@ package body Sem_Util is
then
return;
+ -- If one of the types is a Taft-Amendment type and the other it its
+ -- completion, it must be an illegal use of a TAT in the spec, for
+ -- which an error was already emitted. Avoid cascaded errors.
+
+ elsif Is_Incomplete_Type (Expec_Type)
+ and then Has_Completion_In_Body (Expec_Type)
+ and then Full_View (Expec_Type) = Etype (Expr)
+ then
+ return;
+
+ elsif Is_Incomplete_Type (Etype (Expr))
+ and then Has_Completion_In_Body (Etype (Expr))
+ and then Full_View (Etype (Expr)) = Expec_Type
+ then
+ return;
+
-- In an instance, there is an ongoing problem with completion of
-- type derived from private types. Their structure is what Gigi
-- expects, but the Etype is the parent type rather than the