Synchronous barriers are currently not supported by GNATprove (i.e. it
doesn't recognize that they are initialized by synchronous). They are
specifically detected and rejected as not-in-SPARK, but it is more
elegant to annotate the Ada.Synchronous runtime library unit with
SPARK_Mode => Off.

Compilation is not affected by this annotation.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-09  Piotr Trojanek  <troja...@adacore.com>

gcc/ada/

        * libgnarl/a-synbar.ads, libgnarl/a-synbar.adb,
        libgnarl/a-synbar__posix.ads, libgnarl/a-synbar__posix.adb
        (Ada.Synchronous_Barriers): Annotate with SPARK_Mode => Off.
--- gcc/ada/libgnarl/a-synbar.adb
+++ gcc/ada/libgnarl/a-synbar.adb
@@ -33,7 +33,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-package body Ada.Synchronous_Barriers is
+package body Ada.Synchronous_Barriers with SPARK_Mode => Off is
 
    protected body Synchronous_Barrier is
 

--- gcc/ada/libgnarl/a-synbar.ads
+++ gcc/ada/libgnarl/a-synbar.ads
@@ -33,7 +33,7 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-package Ada.Synchronous_Barriers is
+package Ada.Synchronous_Barriers with SPARK_Mode => Off is
    pragma Preelaborate (Synchronous_Barriers);
 
    subtype Barrier_Limit is Positive range 1 .. Positive'Last;

--- gcc/ada/libgnarl/a-synbar__posix.adb
+++ gcc/ada/libgnarl/a-synbar__posix.adb
@@ -37,7 +37,7 @@
 
 with Interfaces.C; use Interfaces.C;
 
-package body Ada.Synchronous_Barriers is
+package body Ada.Synchronous_Barriers with SPARK_Mode => Off is
 
    --------------------
    -- POSIX barriers --

--- gcc/ada/libgnarl/a-synbar__posix.ads
+++ gcc/ada/libgnarl/a-synbar__posix.ads
@@ -39,7 +39,7 @@ with System;
 private with Ada.Finalization;
 private with Interfaces.C;
 
-package Ada.Synchronous_Barriers is
+package Ada.Synchronous_Barriers with SPARK_Mode => Off is
    pragma Preelaborate (Synchronous_Barriers);
 
    subtype Barrier_Limit is Positive range 1 .. Positive'Last;

Reply via email to