summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog43
-rw-r--r--gcc/ada/a-exctra.ads3
-rw-r--r--gcc/ada/adaint.c2
-rw-r--r--gcc/ada/gnat_ugn.texi2
-rw-r--r--gcc/ada/inline.adb4
-rw-r--r--gcc/ada/sem_aggr.adb10
-rw-r--r--gcc/ada/sem_ch4.adb4
-rw-r--r--gcc/ada/sem_res.adb14
-rw-r--r--gcc/ada/sem_util.adb17
9 files changed, 91 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0b04cd74174..2f3bd34d8b9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,46 @@
+2014-07-30 Ed Schonberg <schonberg@adacore.com>
+
+ * inline.adb (Expand_Inlined_Call): Use a renaming declaration
+ to capture the value of actuals of a limited type rather than
+ an object declaration, to prevent spurious errors when analyzing
+ the inlined body.
+
+2014-07-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_Type_Conversion): Treat an inlined body
+ as an instance, and inhibit semantic checks on already analyzed
+ code to prevent spurious errors.
+
+2014-07-30 Arnaud Charlet <charlet@adacore.com>
+
+ * a-exctra.ads ("="): New function, to restore compatibility.
+
+2014-07-30 Pascal Obry <obry@adacore.com>
+
+ * adaint.c (__gnat_to_os_time): Set isdst to -1 for the mktime
+ routine to use the OS dst setting.
+
+2014-07-30 Pat Rogers <rogers@adacore.com>
+
+ * gnat_ugn.texi: Minor correction to description of -gnatw.K.
+
+2014-07-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.adb (Wrong_Type): Disable some checks equally within
+ instances and within inlined bodies, to suppress spurious type
+ errors on already analyzed code.
+ * sem_aggr.adb (Check_Expr_OK_In_Limited_Aggregate): Expression
+ is legal in an inlined body, juts as it is in an instance body.
+
+2014-07-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb (Resolve_Unchecked_Conversion): Within an inlined
+ body the operand of an unchecked conversion may be a literal, in
+ which case its type is the target type of the conversion. This
+ is in contrast to conversions in other contexts, where the
+ operand cannot be a literal and must be resolvable independent
+ of the context.
+
2014-07-30 Pierre-Marie Derodat <derodat@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Create a
diff --git a/gcc/ada/a-exctra.ads b/gcc/ada/a-exctra.ads
index af1d59b9658..664bd75221f 100644
--- a/gcc/ada/a-exctra.ads
+++ b/gcc/ada/a-exctra.ads
@@ -52,6 +52,9 @@ package Ada.Exceptions.Traceback is
-- occurrence, and returns it formatted in the manner required for
-- processing in GNAT.Traceback. See g-traceb.ads for further details.
+ function "=" (A, B : Tracebacks_Array) return Boolean renames STBE."=";
+ -- Make "=" operator visible directly
+
function Get_PC (TBE : STBE.Traceback_Entry) return Code_Loc
renames STBE.PC_For;
-- Returns the code address held by a given traceback entry, typically the
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index a84f4a5f474..96dedfeb447 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -516,7 +516,7 @@ __gnat_to_os_time (OS_Time *p_time, int year, int month, int day,
v.tm_hour = hours;
v.tm_min = mins;
v.tm_sec = secs;
- v.tm_isdst = 0;
+ v.tm_isdst = -1;
/* returns -1 of failing, this is s-os_lib Invalid_Time */
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index af2c2756510..cc1f7fd47b1 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -5415,7 +5415,7 @@ work as expected. Names of discriminants and components in records are
not included in this check.
@item -gnatw.K
-@emph{Suppress warnings on variables that could be constants.}
+@emph{Suppress warnings on redefinition of names in standard.}
@cindex @option{-gnatwK} (@command{gcc})
This switch activates warnings for declarations that declare a name that
is defined in package Standard.
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index b9d0d8e2722..86704dc052a 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -3834,8 +3834,12 @@ package body Inline is
-- call will pass the parameter by reference, and thus the inlined
-- code will have the same semantics.
+ -- Finally, we need a renaming declaration in the case of limited
+ -- types for which initialization cannot be by copy either.
+
if Ekind (F) = E_In_Parameter
and then not Is_By_Reference_Type (Etype (A))
+ and then not Is_Limited_Type (Etype (A))
and then
(not Is_Array_Type (Etype (A))
or else not Is_Object_Reference (A)
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 157b2024149..3e71ebe0de5 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -111,6 +111,7 @@ package body Sem_Aggr is
-- Check that Expr is either not limited or else is one of the cases of
-- expressions allowed for a limited component association (namely, an
-- aggregate, function call, or <> notation). Report error for violations.
+ -- Expression is also OK in an instance or inlining context.
procedure Check_Qualified_Aggregate (Level : Nat; Expr : Node_Id);
-- Given aggregate Expr, check that sub-aggregates of Expr that are nested
@@ -687,10 +688,13 @@ package body Sem_Aggr is
begin
if Is_Limited_Type (Etype (Expr))
and then Comes_From_Source (Expr)
- and then not In_Instance_Body
then
- if not OK_For_Limited_Init (Etype (Expr), Expr) then
- Error_Msg_N ("initialization not allowed for limited types", Expr);
+ if In_Instance_Body or else In_Inlined_Body then
+ null;
+
+ elsif not OK_For_Limited_Init (Etype (Expr), Expr) then
+ Error_Msg_N
+ ("initialization not allowed for limited types", Expr);
Explain_Limited_Type (Etype (Expr), Expr);
end if;
end if;
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index f7d6aa895b6..b78b06a05e0 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4934,9 +4934,9 @@ package body Sem_Ch4 is
-- error message. Conversely, constant-folding in the generic may
-- transform the argument of a conversion into a string literal, which
-- is legal. Therefore the following tests are not performed in an
- -- instance.
+ -- instance. The same applies to an inlined body.
- elsif In_Instance then
+ elsif In_Instance or In_Inlined_Body then
return;
elsif Nkind (Expr) = N_Null then
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 332bc6090c7..52b717e0593 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -10680,6 +10680,20 @@ package body Sem_Res is
-- Resolve operand using its own type
Resolve (Operand, Opnd_Type);
+
+ -- In an inlined context, the unchecked conversion may be applied
+ -- to a literal, in which case its type is the type of the context.
+ -- (In other contexts conversions cannot apply to literals).
+
+ if In_Inlined_Body
+ and then
+ (Opnd_Type = Any_Character or else
+ Opnd_Type = Any_Integer or else
+ Opnd_Type = Any_Real)
+ then
+ Set_Etype (Operand, Typ);
+ end if;
+
Analyze_Dimension (N);
Eval_Unchecked_Conversion (N);
end Resolve_Unchecked_Type_Conversion;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 916942a6bd0..5aa63a95585 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -17254,7 +17254,11 @@ package body Sem_Util is
-- Similarly, full and partial views may be incorrect in the instance.
-- There is no simple way to insure that it is consistent ???
- elsif In_Instance then
+ -- A similar view discrepancy can happen in an inlined body, for the
+ -- same reason: inserted body may be outside of the original package
+ -- and only partial views are visible at the point of insertion.
+
+ elsif In_Instance or else In_Inlined_Body then
if Etype (Etype (Expr)) = Etype (Expected_Type)
and then
(Has_Private_Declaration (Expected_Type)
@@ -17262,6 +17266,17 @@ package body Sem_Util is
and then No (Parent (Expected_Type))
then
return;
+
+ elsif Nkind (Parent (Expr)) = N_Qualified_Expression
+ and then Entity (Subtype_Mark (Parent (Expr))) = Expected_Type
+ then
+ return;
+
+ elsif Is_Private_Type (Expected_Type)
+ and then Present (Full_View (Expected_Type))
+ and then Covers (Full_View (Expected_Type), Etype (Expr))
+ then
+ return;
end if;
end if;