]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 13:23:00 +0000 (15:23 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 13:23:00 +0000 (15:23 +0200)
2014-08-01  Robert Dewar  <dewar@adacore.com>

* debug.adb: Document debug switch -gnatd.Z.
* sem.adb (Semantics): Force expansion on in no or configurable
run time mode.

2014-08-01  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb (Analyze_Loop_Parameter_Specification): An
unchecked conversion denotes an iterator specification. Such a
conversion will be inserted in the context of an inlined call
when needed, and its argument is always an object.

From-SVN: r213456

gcc/ada/ChangeLog
gcc/ada/debug.adb
gcc/ada/sem.adb
gcc/ada/sem_ch5.adb

index 811742cfc32d76d088890152d4539b36b0cbaa2d..de5593239c676f2eca978c254f82ab8318ef73f3 100644 (file)
@@ -1,3 +1,16 @@
+2014-08-01  Robert Dewar  <dewar@adacore.com>
+
+       * debug.adb: Document debug switch -gnatd.Z.
+       * sem.adb (Semantics): Force expansion on in no or configurable
+       run time mode.
+
+2014-08-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb (Analyze_Loop_Parameter_Specification): An
+       unchecked conversion denotes an iterator specification. Such a
+       conversion will be inserted in the context of an inlined call
+       when needed, and its argument is always an object.
+
 2014-08-01  Robert Dewar  <dewar@adacore.com>
 
        * make.adb, makeutl.ads: Minor reformatting.
index 0896c85f7d697aa80f27d577f75d5d554be6f602..715e44ad748810f7affa356e27448be41fab610b 100644 (file)
@@ -143,7 +143,7 @@ package body Debug is
    --  d.W  Print out debugging information for Walk_Library_Items
    --  d.X  Old treatment of indexing aspects
    --  d.Y
-   --  d.Z
+   --  d.Z  Do not enable expansion in configurable run-time mode
 
    --  d1   Error msgs have node numbers where possible
    --  d2   Eliminate error flags in verbose form error messages
@@ -686,6 +686,12 @@ package body Debug is
    --       is preserved temporarily for use by the modelling project under
    --       debug flag d.X.
 
+   --  d.Z  Normally we always enable expansion in configurable run-time mode
+   --       to make sure we get error messages about unsupported features even
+   --       when compiling in -gnatc mode. But expansion is turned off in this
+   --       case if debug flag -gnatd.Z is used. This is to deal with the case
+   --       where we discover difficulties in this new processing.
+
    --  d1   Error messages have node numbers where possible. Normally error
    --       messages have only source locations. This option is useful when
    --       debugging errors caused by expanded code, where the source location
index eb3501ed3a61d82a9186fdfa0eb67d9faaf65069..73f345e99896bc8e4f6c1df273522bce87828b45 100644 (file)
@@ -1410,11 +1410,33 @@ package body Sem is
          GNAT_Mode := True;
       end if;
 
+      --  For generic main, never do expansion
+
       if Generic_Main then
          Expander_Mode_Save_And_Set (False);
+
+      --  Non generic case
+
       else
          Expander_Mode_Save_And_Set
-           (Operating_Mode = Generate_Code or Debug_Flag_X);
+
+           --  Turn on expansion if generating code
+
+           (Operating_Mode = Generate_Code
+
+             --  or if special debug flag -gnatdx is set
+
+             or else Debug_Flag_X
+
+             --  Or if in configuration run-time mode. We do this so we get
+             --  error messages about missing entities in the run-time even
+             --  if we are compiling in -gnatc (no code generation) mode.
+             --  Similar processing applies to No_Run_Time_Mode. However,
+             --  don't do this if debug flag -gnatd.Z is set (this is to handle
+             --  a situation where this new processing causes trouble).
+
+             or else ((Configurable_Run_Time_Mode or No_Run_Time_Mode)
+                       and not Debug_Flag_Dot_ZZ));
       end if;
 
       Full_Analysis      := True;
index 3d8d3f60b142a5ba548f51c8dc87d2a4128634ce..ffdf8814e52ddd8203d7cd60f8e5d99554df46b6 100644 (file)
@@ -2510,16 +2510,21 @@ package body Sem_Ch5 is
          --  a)  a function call,
          --  b)  an identifier that is not a type,
          --  c)  an attribute reference 'Old (within a postcondition)
+         --  d)  an unchecked conversion
 
          --  then it is an iteration over a container. It was classified as
          --  a loop specification by the parser, and must be rewritten now
-         --  to activate container iteration.
+         --  to activate container iteration. The last case will occur within
+         --  an expanded inlined call, where the expansion wraps an actual in
+         --  an unchecked conversion when needed. The expression of the
+         --  conversion is always an object.
 
          if Nkind (DS_Copy) = N_Function_Call
            or else (Is_Entity_Name (DS_Copy)
                      and then not Is_Type (Entity (DS_Copy)))
            or else (Nkind (DS_Copy) = N_Attribute_Reference
                      and then Attribute_Name (DS_Copy) = Name_Old)
+           or else Nkind (DS_Copy) = N_Unchecked_Type_Conversion
          then
             --  This is an iterator specification. Rewrite it as such and
             --  analyze it to capture function calls that may require