aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-11-09 12:52:41 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-11-09 12:52:41 +0000
commit614bc51c3f2a933e694013e6c867dfdcd153017f (patch)
tree50210e9e0eee6738ad443a769a0229c1c8090afc /gcc
parent5612989e5b06ce72f7c50cd6244c4c98ac4d3c76 (diff)
downloadgcc-614bc51c3f2a933e694013e6c867dfdcd153017f.zip
gcc-614bc51c3f2a933e694013e6c867dfdcd153017f.tar.gz
gcc-614bc51c3f2a933e694013e6c867dfdcd153017f.tar.bz2
[multiple changes]
2017-11-09 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Subprogram_Instantiation): Correct use of uninitialized variable uncovered by Codepeer. 2017-11-09 Arnaud Charlet <charlet@adacore.com> * namet.adb: Replace pragma Assume by pragma Assert to fix bootstrap. 2017-11-09 Javier Miranda <miranda@adacore.com> * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: (Static_Dispatch_Tables): Minor rewording. * gnat_rm.texi: Regenerate. 2017-11-09 Justin Squirek <squirek@adacore.com> * sem_ch8.adb (Analyze_Use_Package): Remove forced installation of use_clauses within instances. (Use_One_Package): Add condition to check for "hidden" open scopes to avoid skipping over packages that have not been properly installed even though they are visible. 2017-11-09 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Selected_Component): Reject properly a call to a private operation of a protected type, when the type has no visible operations. From-SVN: r254578
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog29
-rw-r--r--gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst2
-rw-r--r--gcc/ada/gnat_rm.texi2
-rw-r--r--gcc/ada/namet.adb8
-rw-r--r--gcc/ada/sem_ch12.adb5
-rw-r--r--gcc/ada/sem_ch4.adb5
-rw-r--r--gcc/ada/sem_ch8.adb10
7 files changed, 49 insertions, 12 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d2a48f7..72d5844 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,32 @@
+2017-11-09 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Analyze_Subprogram_Instantiation): Correct use of
+ uninitialized variable uncovered by Codepeer.
+
+2017-11-09 Arnaud Charlet <charlet@adacore.com>
+
+ * namet.adb: Replace pragma Assume by pragma Assert to fix bootstrap.
+
+2017-11-09 Javier Miranda <miranda@adacore.com>
+
+ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
+ (Static_Dispatch_Tables): Minor rewording.
+ * gnat_rm.texi: Regenerate.
+
+2017-11-09 Justin Squirek <squirek@adacore.com>
+
+ * sem_ch8.adb (Analyze_Use_Package): Remove forced installation of
+ use_clauses within instances.
+ (Use_One_Package): Add condition to check for "hidden" open scopes to
+ avoid skipping over packages that have not been properly installed even
+ though they are visible.
+
+2017-11-09 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_Selected_Component): Reject properly a call to a
+ private operation of a protected type, when the type has no visible
+ operations.
+
2017-11-09 Javier Miranda <miranda@adacore.com>
* rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_HT_Link.
diff --git a/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst b/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
index 2174636..1f56403 100644
--- a/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
+++ b/gcc/ada/doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
@@ -992,7 +992,7 @@ Static_Dispatch_Tables
----------------------
.. index:: Static_Dispatch_Tables
-[GNAT] This restriction ensures at compile time that all the artifacts
+[GNAT] This restriction checks at compile time that all the artifacts
associated with dispatch tables can be placed in read-only memory.
SPARK_05
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 21c195d2..0a2b151 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -13141,7 +13141,7 @@ type @code{Character}).
@geindex Static_Dispatch_Tables
-[GNAT] This restriction ensures at compile time that all the artifacts
+[GNAT] This restriction checks at compile time that all the artifacts
associated with dispatch tables can be placed in read-only memory.
@node SPARK_05,,Static_Dispatch_Tables,Program Unit Level Restrictions
diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb
index 153c79b..04e92da 100644
--- a/gcc/ada/namet.adb
+++ b/gcc/ada/namet.adb
@@ -261,8 +261,10 @@ package body Namet is
declare
W2 : constant Word := Hex (2);
begin
- pragma Assume (W2 <= 255);
- -- Add assumption to facilitate static analysis
+ pragma Assert (W2 <= 255);
+ -- Add assumption to facilitate static analysis. Note
+ -- that we cannot use pragma Assume for bootstrap
+ -- reasons.
Insert_Character (Character'Val (W2));
end;
end if;
@@ -759,7 +761,7 @@ package body Namet is
Write_Eol;
Write_Str ("Average number of probes for lookup = ");
- pragma Assume (Nsyms /= 0);
+ pragma Assert (Nsyms /= 0);
-- Add assumption to facilitate static analysis. Here Nsyms cannot be
-- zero because many symbols are added to the table by default.
Probes := Probes / Nsyms;
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 6cdc9f3..7aca1d9 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -5130,6 +5130,7 @@ package body Sem_Ch12 is
is
Loc : constant Source_Ptr := Sloc (N);
Gen_Id : constant Node_Id := Name (N);
+ Errs : constant Nat := Serious_Errors_Detected;
Anon_Id : constant Entity_Id :=
Make_Defining_Identifier (Sloc (Defining_Entity (N)),
@@ -5723,7 +5724,9 @@ package body Sem_Ch12 is
end if;
<<Leave>>
- if Has_Aspects (N) then
+ -- Analyze aspects in declaration if no errors appear in the instance.
+
+ if Has_Aspects (N) and then Serious_Errors_Detected = Errs then
Analyze_Aspect_Specifications (N, Act_Decl_Id);
end if;
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index f2d1acf..d13140f 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -5043,10 +5043,13 @@ package body Sem_Ch4 is
end if;
end if;
- Next_Entity (Comp);
+ -- Do not examine private operations if not within scope of
+ -- the synchronized type.
+
exit when not In_Scope
and then
Comp = First_Private_Entity (Base_Type (Prefix_Type));
+ Next_Entity (Comp);
end loop;
-- If the scope is a current instance, the prefix cannot be an
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index aea9bf8..d8d5b7b 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -3821,10 +3821,7 @@ package body Sem_Ch8 is
Check_In_Previous_With_Clause (N, Name (N));
end if;
- -- Force the use_clause when we are in a generic instance because the
- -- scope of the package has changed and we must ensure visibility.
-
- Use_One_Package (N, Name (N), Force => In_Instance);
+ Use_One_Package (N, Name (N));
-- Capture the first Ghost package and the first living package
@@ -9443,7 +9440,10 @@ package body Sem_Ch8 is
-- Warn about detected redundant clauses
- elsif In_Open_Scopes (P) and not Force then
+ elsif not Force
+ and then In_Open_Scopes (P)
+ and then not Is_Hidden_Open_Scope (P)
+ then
if Warn_On_Redundant_Constructs and then P = Current_Scope then
Error_Msg_NE -- CODEFIX
("& is already use-visible within itself?r?",