summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 16:09:10 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 16:09:10 +0000
commit62616039e9755ca380437d7f11c9f3f599450b27 (patch)
treef9333a9cb727b17699ecf799b4cf9098ec094277
parentf57bff3b23b4283841577209dc643c94dfdc3786 (diff)
downloadgcc-62616039e9755ca380437d7f11c9f3f599450b27.tar.gz
2011-08-01 Javier Miranda <miranda@adacore.com>
* sem_disp.adb (Override_Dispatching_Operation): Enforce strictness of condition that detects if the overridden operation must replace an existing entity. 2011-08-01 Javier Miranda <miranda@adacore.com> * exp_ch4.adb (Expand_N_Case_Expression): Propagate to the expanded code declarations inserted by Insert_Actions in each alternative of the N_Case_Expression node. 2011-08-01 Robert Dewar <dewar@adacore.com> * sem_ch6.adb: Minor code reorganization. * sem_util.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177059 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/exp_ch4.adb5
-rw-r--r--gcc/ada/sem_ch6.adb2
-rw-r--r--gcc/ada/sem_disp.adb12
-rw-r--r--gcc/ada/sem_util.adb7
5 files changed, 34 insertions, 9 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 591bd6acdc3..b171ba0c213 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2011-08-01 Javier Miranda <miranda@adacore.com>
+
+ * sem_disp.adb (Override_Dispatching_Operation): Enforce strictness of
+ condition that detects if the overridden operation must replace an
+ existing entity.
+
+2011-08-01 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Case_Expression): Propagate to the expanded
+ code declarations inserted by Insert_Actions in each alternative of the
+ N_Case_Expression node.
+
+2011-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch6.adb: Minor code reorganization.
+ * sem_util.adb: Minor reformatting.
+
2011-08-01 Pascal Obry <obry@adacore.com>
* prj-env.adb: Remove <prefix>/lib/gpr/<target> project search path.
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 5615ac912dd..a0c4104b331 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -4018,6 +4018,11 @@ package body Exp_Ch4 is
Aloc : constant Source_Ptr := Sloc (Aexp);
begin
+ -- Propagate declarations inserted in the node by Insert_Actions
+ -- (for example, temporaries generated to remove side effects).
+
+ Append_List_To (Actions, Sinfo.Actions (Alt));
+
if not Is_Scalar_Type (Typ) then
Aexp :=
Make_Attribute_Reference (Aloc,
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 992222198d7..84bb761e190 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1855,7 +1855,7 @@ package body Sem_Ch6 is
Last_Source_Node_In_Sequence (Statements (HSS));
begin
if Present (Stat)
- and then not Nkind_In (Nkind (Stat),
+ and then not Nkind_In (Stat,
N_Simple_Return_Statement,
N_Extended_Return_Statement)
then
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index 818f9b85574..450716bd9e6 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -2078,15 +2078,19 @@ package body Sem_Disp is
-- The location of entities that come from source in the list of
-- primitives of the tagged type must follow their order of occurrence
-- in the sources to fulfill the C++ ABI. If the overridden entity is a
- -- primitive of an interface that is not an ancestor of this tagged
- -- type (that is, it is an entity added to the list of primitives by
- -- Derive_Interface_Progenitors), then we must append the new entity
- -- at the end of the list of primitives.
+ -- primitive of an interface that is not implemented by the parents of
+ -- this tagged type (that is, it is an alias of an interface primitive
+ -- generated by Derive_Interface_Progenitors), then we must append the
+ -- new entity at the end of the list of primitives.
if Present (Alias (Prev_Op))
+ and then Etype (Tagged_Type) /= Tagged_Type
and then Is_Interface (Find_Dispatching_Type (Alias (Prev_Op)))
and then not Is_Ancestor (Find_Dispatching_Type (Alias (Prev_Op)),
Tagged_Type)
+ and then not Implements_Interface
+ (Etype (Tagged_Type),
+ Find_Dispatching_Type (Alias (Prev_Op)))
then
Remove_Elmt (Primitive_Operations (Tagged_Type), Elmt);
Append_Elmt (New_Op, Primitive_Operations (Tagged_Type));
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index e93a2997091..9a9b60e395a 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -7986,13 +7986,12 @@ package body Sem_Util is
----------------------------------
function Last_Source_Node_In_Sequence (List : List_Id) return Node_Id is
- N : Node_Id := Last (List);
+ N : Node_Id;
+
begin
+ N := Last (List);
while Present (N) loop
exit when Comes_From_Source (N);
-
- -- Reach before the generated statements at the end of the function
-
N := Prev (N);
end loop;