2014-10-10 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Oct 2014 14:42:22 +0000 (14:42 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Oct 2014 14:42:22 +0000 (14:42 +0000)
* sem_ch13.adb (Analyze_Aspect_Specifications, Library_Unit_Aspects):
Aspect specification is legal on a local instantiation of a
library-level generic unit.

2014-10-10  Gary Dismukes  <dismukes@adacore.com>

* gnat1drv.adb (Adjust_Global_Switches): Set Front_End_Inlining
if inlining has been enabled via -gnatn and the target is not GCC.

2014-10-10  Ed Schonberg  <schonberg@adacore.com>

* freeze.adb (Freeze_Entity): Freezing a subprogram does
not always freeze its profile. In particular, an attribute
reference that takes the access type does not freeze the types
of the formals.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216090 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/freeze.adb
gcc/ada/gnat1drv.adb
gcc/ada/sem_ch13.adb

index 6de6c99..50e654c 100644 (file)
@@ -1,3 +1,21 @@
+2014-10-10  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch13.adb (Analyze_Aspect_Specifications, Library_Unit_Aspects):
+       Aspect specification is legal on a local instantiation of a
+       library-level generic unit.
+
+2014-10-10  Gary Dismukes  <dismukes@adacore.com>
+
+       * gnat1drv.adb (Adjust_Global_Switches): Set Front_End_Inlining
+       if inlining has been enabled via -gnatn and the target is not GCC.
+
+2014-10-10  Ed Schonberg  <schonberg@adacore.com>
+
+       * freeze.adb (Freeze_Entity): Freezing a subprogram does
+       not always freeze its profile.  In particular, an attribute
+       reference that takes the access type does not freeze the types
+       of the formals.
+
 2014-10-10  Robert Dewar  <dewar@adacore.com>
 
        * errout.adb (Adjust_Name_Case): New procedure.
index 7fdd2ab..bdc2ea1 100644 (file)
@@ -4004,7 +4004,17 @@ package body Freeze is
             --  any extra formal parameters are created since we now know
             --  whether the subprogram will use a foreign convention.
 
-            if not Is_Internal (E) then
+            --  In Ada 2012, freezing a subprogram does not always freeze
+            --  the corresponding profile (see AI05-019). An attribute
+            --  reference is not a freezing point of the profile.
+            --  Other constructs that should not freeze ???
+
+            if Ada_Version > Ada_2005
+              and then Nkind (N) = N_Attribute_Reference
+            then
+               null;
+
+            elsif not Is_Internal (E) then
                declare
                   F_Type    : Entity_Id;
                   R_Type    : Entity_Id;
index 50f4bef..545d143 100644 (file)
@@ -583,6 +583,12 @@ procedure Gnat1drv is
          end if;
       end if;
 
+      --  Treat -gnatn as equivalent to -gnatN for non-GCC targets
+
+      if Inline_Active and then not Front_End_Inlining then
+         Front_End_Inlining := VM_Target /= No_VM or else AAMP_On_Target;
+      end if;
+
       --  Set back end inlining indication
 
       Back_End_Inlining :=
index 709dabe..ca11c72 100644 (file)
@@ -3018,12 +3018,15 @@ package body Sem_Ch13 is
                   --  of a package declaration, the pragma needs to be inserted
                   --  in the list of declarations for the associated package.
                   --  There is no issue of visibility delay for these aspects.
+                  --  Aspect is legal on a local instantiation of a library-
+                  --  level generic unit.
 
                   if A_Id in Library_Unit_Aspects
                     and then
                       Nkind_In (N, N_Package_Declaration,
                                    N_Generic_Package_Declaration)
                     and then Nkind (Parent (N)) /= N_Compilation_Unit
+                    and then not Is_Generic_Instance (Defining_Entity (N))
                   then
                      Error_Msg_N
                        ("incorrect context for library unit aspect&", Id);