aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/exp_attr.adb8
-rw-r--r--gcc/ada/freeze.adb8
-rw-r--r--gcc/ada/sem_ch8.adb38
4 files changed, 55 insertions, 16 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 067ba8f..d0cc96a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2016-04-21 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Suppress
+ expansion of Attribute_Machine and Attribute_Model for AAMP.
+
+2016-04-21 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb: Disable previous change for now.
+
+2016-04-21 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Find_Selected_Component): If prefix has an
+ access type and designated type is a limited view, introduce
+ an explicit dereference before continuing the analysis, and
+ set its type to the non-limited view of the designated type,
+ if we are in context where it is available.
+
2016-04-21 Ed Schonberg <schonberg@adacore.com>
* freeze.adb: Freeze profile in ASIS mode.
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index cfbba77..28e1f65 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -7993,13 +7993,13 @@ package body Exp_Attr is
and then not Generate_C_Code;
end Is_GCC_Target;
- -- Start of processing for Exp_Attr
+ -- Start of processing for Is_Inline_Floating_Point_Attribute
begin
- -- Machine and Model can be expanded by the GCC backend only
+ -- Machine and Model can be expanded by the GCC and AAMP back ends only
if Id = Attribute_Machine or else Id = Attribute_Model then
- return Is_GCC_Target;
+ return Is_GCC_Target or else AAMP_On_Target;
-- Remaining cases handled by all back ends are Rounding and Truncation
-- when appearing as the operand of a conversion to some integer type.
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 2f6ab82..ba95f26 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -5008,11 +5008,13 @@ package body Freeze is
-- Other constructs that should not freeze ???
-- This processing doesn't apply to internal entities (see below)
- -- In ASIS mode the profile is frozen unconditionally, to prevent
- -- backend anomalies.
+
+ -- Disable this mechanism for now, to fix regressions in ASIS and
+ -- various ACATS tests. Implementation of AI05-019 remains
+ -- unsolved ???
if not Is_Internal (E)
- and then (Do_Freeze_Profile or ASIS_Mode)
+ and then (Do_Freeze_Profile or else True)
then
if not Freeze_Profile (E) then
Ghost_Mode := Save_Ghost_Mode;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 73303f4..842bb23 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -6729,17 +6729,27 @@ package body Sem_Ch8 is
-- The designated type may be a limited view with no components.
-- Check whether the non-limited view is available, because in some
- -- cases this will not be set when installing the context.
+ -- cases this will not be set when installing the context. Rewrite
+ -- the node by introducing an explicit dereference at once, and
+ -- setting the type of the rewritten prefix to the non-limited view
+ -- of the original designated type.
if Is_Access_Type (P_Type) then
declare
- D : constant Entity_Id := Directly_Designated_Type (P_Type);
+ Desig_Typ : constant Entity_Id :=
+ Directly_Designated_Type (P_Type);
+
begin
- if Is_Incomplete_Type (D)
- and then From_Limited_With (D)
- and then Present (Non_Limited_View (D))
+ if Is_Incomplete_Type (Desig_Typ)
+ and then From_Limited_With (Desig_Typ)
+ and then Present (Non_Limited_View (Desig_Typ))
then
- Set_Directly_Designated_Type (P_Type, Non_Limited_View (D));
+ Rewrite (P,
+ Make_Explicit_Dereference (Sloc (P),
+ Prefix => Relocate_Node (P)));
+
+ Set_Etype (P, Get_Full_View (Non_Limited_View (Desig_Typ)));
+ P_Type := Etype (P);
end if;
end;
end if;
@@ -6930,9 +6940,19 @@ package body Sem_Ch8 is
else
-- Format node as expanded name, to avoid cascaded errors
+ -- If the limited_with transformation was applied earlier,
+ -- restore source for proper error reporting.
+
+ if not Comes_From_Source (P)
+ and then Nkind (P) = N_Explicit_Dereference
+ then
+ Rewrite (P, Prefix (P));
+ P_Type := Etype (P);
+ end if;
+
Change_Selected_Component_To_Expanded_Name (N);
- Set_Entity (N, Any_Id);
- Set_Etype (N, Any_Type);
+ Set_Entity (N, Any_Id);
+ Set_Etype (N, Any_Type);
-- Issue error message, but avoid this if error issued already.
-- Use identifier of prefix if one is available.