* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178307
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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
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.
-- of this restriction.
if not Expander_Active
+ or else ALFA_Mode
or else Restriction_Active (No_Dispatching_Calls)
then
return;
-- --
-- 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- --
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);
-- --
-- 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- --
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, "")
}
/*
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);
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);
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);
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);
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);
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)
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;
null;
elsif Expander_Active
+ and then not ALFA_Mode
and then Is_Type (Etype (Nam))
and then Requires_Transient_Scope (Etype (Nam))
and then
-- 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);
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