summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-22 13:09:00 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-22 13:09:00 +0000
commitf15d3bdc564b13672f679bcf95afdc455d23535e (patch)
treee92efea704727ffef2eba16c1664d278b20bfe2f /gcc
parente8bd8f68489fdfe8512c22f78857e8feaf4b0327 (diff)
downloadgcc-f15d3bdc564b13672f679bcf95afdc455d23535e.tar.gz
2009-06-22 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Overriding_Indicator): Clean up code, make warning unconditional rather than a style check, because a formal name out of order is suspicious. 2009-06-22 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Locate_Directory): Indicate the project name when creating a directory automatically. 2009-06-22 Eric Botcazou <ebotcazou@adacore.com> * sem_ch3.adb (Create_Constrained_Components): For a subtype of an untagged derived type, add a hidden component for every constrained discriminant of the parent type to keep record layout consistent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148792 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/prj-nmsc.adb3
-rw-r--r--gcc/ada/sem_ch3.adb24
-rw-r--r--gcc/ada/sem_ch6.adb11
4 files changed, 44 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 86b0ae32534..343de41a157 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2009-06-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Check_Overriding_Indicator): Clean up code, make warning
+ unconditional rather than a style check, because a formal name out of
+ order is suspicious.
+
+2009-06-22 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Locate_Directory): Indicate the project name when
+ creating a directory automatically.
+
+2009-06-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_ch3.adb (Create_Constrained_Components): For a subtype of an
+ untagged derived type, add a hidden component for every constrained
+ discriminant of the parent type to keep record layout consistent.
+
2009-06-22 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb: Minor code reorganization (avoid an unnecessary tree
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index f1f5550dc8c..2f8b027fdac 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -6551,7 +6551,8 @@ package body Prj.Nmsc is
Write_Str (Create);
Write_Str (" directory """);
Write_Str (Full_Path_Name.all);
- Write_Line (""" created");
+ Write_Str (""" created for project ");
+ Write_Line (Get_Name_String (Project.Name));
end if;
exception
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index dcc8736d79d..3e334686b73 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -11246,9 +11246,9 @@ package body Sem_Ch3 is
and then Is_Completely_Hidden (Old_Compon)
then
-- This is a shadow discriminant created for a discriminant of
- -- the parent type that is one of several renamed by the same
- -- new discriminant. Give the shadow discriminant an internal
- -- name that cannot conflict with that of visible components.
+ -- the parent type, which needs to be present in the subtype.
+ -- Give the shadow discriminant an internal name that cannot
+ -- conflict with that of visible components.
Set_Chars (New_Compon, New_Internal_Name ('C'));
end if;
@@ -11351,10 +11351,11 @@ package body Sem_Ch3 is
-- For an untagged derived subtype, the number of discriminants may
-- be smaller than the number of inherited discriminants, because
- -- several of them may be renamed by a single new discriminant.
- -- In this case, add the hidden discriminants back into the subtype,
- -- because otherwise the size of the subtype is computed incorrectly
- -- in GCC 4.1.
+ -- several of them may be renamed by a single new discriminant or
+ -- constrained. In this case, add the hidden discriminants back into
+ -- the subtype, because they need to be present if the optimizer of
+ -- the GCC 4.x back-end decides to break apart assignments between
+ -- objects using the parent view into member-wise assignments.
Num_Gird := 0;
@@ -11401,8 +11402,15 @@ package body Sem_Ch3 is
-- component for the current old discriminant.
New_C := Create_Component (Old_Discr);
- Set_Original_Record_Component (New_C, Old_Discr);
+ Set_Original_Record_Component (New_C, Old_Discr);
end if;
+
+ else
+ -- The constraint has eliminated the old discriminant.
+ -- Introduce a shadow component.
+
+ New_C := Create_Component (Old_Discr);
+ Set_Original_Record_Component (New_C, Old_Discr);
end if;
Next_Elmt (Constr);
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index ed1f745b1fd..1b4abcb6e6f 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -4381,8 +4381,7 @@ package body Sem_Ch6 is
-- often carry names that reflect the type, and it is not worthwhile
-- requiring that their names match.
- if Style_Check
- and then Present (Overridden_Subp)
+ if Present (Overridden_Subp)
and then Nkind (Subp) /= N_Defining_Operator_Symbol
then
declare
@@ -4393,6 +4392,14 @@ package body Sem_Ch6 is
Form1 := First_Formal (Subp);
Form2 := First_Formal (Overridden_Subp);
+ -- If the overriding operation is a synchronized operation, skip
+ -- the first parameter of the overridden operation, which is
+ -- implicit in the new one.
+
+ if Is_Concurrent_Type (Scope (Subp)) then
+ Form2 := Next_Formal (Form2);
+ end if;
+
if Present (Form1) then
Form1 := Next_Formal (Form1);
Form2 := Next_Formal (Form2);