aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 12:11:06 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 12:11:06 +0200
commitb0cd50fdc3c2c8a0221a1c7d8379f4c7e15e623f (patch)
treed3a8805b202977065c048d4fa21cf0d92f1e0bc3 /gcc/ada
parentd8ee014f291458a3518ea516619e75faf24aca17 (diff)
downloadgcc-b0cd50fdc3c2c8a0221a1c7d8379f4c7e15e623f.zip
gcc-b0cd50fdc3c2c8a0221a1c7d8379f4c7e15e623f.tar.gz
gcc-b0cd50fdc3c2c8a0221a1c7d8379f4c7e15e623f.tar.bz2
[multiple changes]
2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Insert_Valid_Check): Do not generate a validity check when inside a generic. 2017-04-25 Yannick Moy <moy@adacore.com> * sem_res.adb (Resolve_Type_Conversion): Fix bad logic. 2017-04-25 Arnaud Charlet <charlet@adacore.com> * snames.ads-tmpl (Snames): More names for detecting predefined potentially blocking subprograms. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pre_Post_Condition): The rules concerning inheritance of class-wide preconditions do not apply to postconditions. 2017-04-25 Bob Duff <duff@adacore.com> * s-ficobl.ads: Minor comment fix. From-SVN: r247174
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog24
-rw-r--r--gcc/ada/checks.adb12
-rw-r--r--gcc/ada/s-ficobl.ads4
-rw-r--r--gcc/ada/sem_prag.adb1
-rw-r--r--gcc/ada/sem_res.adb10
-rw-r--r--gcc/ada/snames.ads-tmpl4
6 files changed, 44 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0a7a782..a3ceadb 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,27 @@
+2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * checks.adb (Insert_Valid_Check): Do not generate
+ a validity check when inside a generic.
+
+2017-04-25 Yannick Moy <moy@adacore.com>
+
+ * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
+
+2017-04-25 Arnaud Charlet <charlet@adacore.com>
+
+ * snames.ads-tmpl (Snames): More names for detecting predefined
+ potentially blocking subprograms.
+
+2017-04-25 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
+ concerning inheritance of class-wide preconditions do not apply
+ to postconditions.
+
+2017-04-25 Bob Duff <duff@adacore.com>
+
+ * s-ficobl.ads: Minor comment fix.
+
2017-04-25 Yannick Moy <moy@adacore.com>
* checks.adb (Apply_Scalar_Range_Check): Analyze precisely
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index a057cf3..61fb006 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -7233,27 +7233,31 @@ package body Checks is
or else Expr_Known_Valid (Expr)
then
return;
- end if;
-- Do not insert checks within a predicate function. This will arise
-- if the current unit and the predicate function are being compiled
-- with validity checks enabled.
- if Present (Predicate_Function (Typ))
+ elsif Present (Predicate_Function (Typ))
and then Current_Scope = Predicate_Function (Typ)
then
return;
- end if;
-- If the expression is a packed component of a modular type of the
-- right size, the data is always valid.
- if Nkind (Expr) = N_Selected_Component
+ elsif Nkind (Expr) = N_Selected_Component
and then Present (Component_Clause (Entity (Selector_Name (Expr))))
and then Is_Modular_Integer_Type (Typ)
and then Modulus (Typ) = 2 ** Esize (Entity (Selector_Name (Expr)))
then
return;
+
+ -- Do not generate a validity check when inside a generic unit as this
+ -- is an expansion activity.
+
+ elsif Inside_A_Generic then
+ return;
end if;
-- If we have a checked conversion, then validity check applies to
diff --git a/gcc/ada/s-ficobl.ads b/gcc/ada/s-ficobl.ads
index 047baca..a95c039 100644
--- a/gcc/ada/s-ficobl.ads
+++ b/gcc/ada/s-ficobl.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, 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- --
@@ -89,7 +89,7 @@ package System.File_Control_Block is
Name : Pstring;
-- A pointer to the file name. The file name is null for temporary
-- files, and also for standard files (stdin, stdout, stderr). The
- -- name is always null-terminated if it is non-null.
+ -- name is always NUL-terminated if it is non-null.
Encoding : System.CRTL.Filename_Encoding;
-- Encoding used to specified the filename
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index fee1bb3..f549198 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -4417,6 +4417,7 @@ package body Sem_Prag is
begin
if Class_Present (N)
+ and then Pragma_Name (N) = Name_Precondition
and then Present (Overridden_Operation (E))
and then not Inherits_Class_Wide_Pre (E)
then
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 70e0c28..b3e2c28 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -11055,17 +11055,17 @@ package body Sem_Res is
-- If at this stage we have a real to integer conversion, make sure that
-- the Do_Range_Check flag is set, because such conversions in general
- -- need a range check. We only need this if expansion is off, or we are
- -- in GNATprove mode and the conversion if from fixed-point to integer
+ -- need a range check. We only need this if expansion is off.
+ -- In GNATprove mode, we only do that when converting from fixed-point
-- (as floating-point to integer conversions are now handled in
-- GNATprove mode).
if Nkind (N) = N_Type_Conversion
and then not Expander_Active
and then Is_Integer_Type (Target_Typ)
- and then (Is_Real_Type (Operand_Typ)
- or else (GNATprove_Mode
- and then Is_Fixed_Point_Type (Operand_Typ)))
+ and then (Is_Fixed_Point_Type (Operand_Typ)
+ or else (not GNATprove_Mode
+ and then Is_Floating_Point_Type (Operand_Typ)))
then
Set_Do_Range_Check (Operand);
end if;
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 33ba6a5..bfa5e30 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -275,14 +275,18 @@ package Snames is
Name_EDF : constant Name_Id := N + $;
Name_Reset_Standard_Files : constant Name_Id := N + $;
Name_Sequential_IO : constant Name_Id := N + $;
+ Name_Strings : constant Name_Id := N + $;
Name_Streams : constant Name_Id := N + $;
Name_Suspend_Until_True : constant Name_Id := N + $;
Name_Suspend_Until_True_And_Set_Deadline : constant Name_Id := N + $;
Name_Synchronous_Barriers : constant Name_Id := N + $;
Name_Task_Identification : constant Name_Id := N + $;
Name_Text_Streams : constant Name_Id := N + $;
+ Name_Unbounded : constant Name_Id := N + $;
Name_Unbounded_IO : constant Name_Id := N + $;
Name_Wait_For_Release : constant Name_Id := N + $;
+ Name_Wide_Unbounded : constant Name_Id := N + $;
+ Name_Wide_Wide_Unbounded : constant Name_Id := N + $;
Name_Yield : constant Name_Id := N + $;
-- Names of implementations of the distributed systems annex