[multiple changes]
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 16 Nov 2017 15:56:41 +0000 (15:56 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 16 Nov 2017 15:56:41 +0000 (15:56 +0000)
2017-11-16  Steve Baird  <baird@adacore.com>

* debug.adb: Update another comment to indicate gnat2scil's use of the
-gnatd.7 switch.

2017-11-16  Bob Duff  <duff@adacore.com>

* exp_ch6.adb (Expand_Call_Helper): Avoid creating a transient scope in
the case of nested build-in-place calls.

From-SVN: r254827

gcc/ada/ChangeLog
gcc/ada/debug.adb
gcc/ada/exp_ch6.adb

index 0cc9d30..080cd67 100644 (file)
@@ -1,3 +1,13 @@
+2017-11-16  Steve Baird  <baird@adacore.com>
+
+       * debug.adb: Update another comment to indicate gnat2scil's use of the
+       -gnatd.7 switch.
+
+2017-11-16  Bob Duff  <duff@adacore.com>
+
+       * exp_ch6.adb (Expand_Call_Helper): Avoid creating a transient scope in
+       the case of nested build-in-place calls.
+
 2017-11-16  Joel Brobecker  <brobecker@adacore.com>
 
        * doc/gnat_ugn/gnat_utility_programs.rst: Document the switches
index 75e9591..06bec39 100644 (file)
@@ -827,6 +827,12 @@ package body Debug is
    --       referenced by the generated C code. This debug flag restores the
    --       output of all the types.
 
+   --  d.7  Indicates (to gnat2scil) that CodePeer is being invoked as a
+   --       prover by the SPARK tools and that therefore gnat2scil should
+   --       avoid SCIL generation strategies which can introduce soundness
+   --       issues (e.g., assuming that a low bound of an array parameter
+   --       of an unconstrained subtype belongs to the index subtype).
+
    --  d.9  Enable build-in-place for function calls returning some nonlimited
    --       types.
 
index 357979e..0b36110 100644 (file)
@@ -4354,6 +4354,10 @@ package body Exp_Ch6 is
                               N_Procedure_Call_Statement,
                               N_Selected_Component,
                               N_Slice)
+           and then
+             (Ekind (Current_Scope) /= E_Loop
+               or else Nkind (Parent (N)) /= N_Function_Call
+               or else not Is_Build_In_Place_Function_Call (Parent (N)))
          then
             Establish_Transient_Scope (Call_Node, Sec_Stack => True);
          end if;