aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2011-08-30 13:23:33 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-30 15:23:33 +0200
commit6d4e4fbcd2f5c5a73d263c4f45b0438d7dec9492 (patch)
treec1c905b268ac4a15da6e463ef91f8fb021829a19 /gcc
parentd15f94220de07aa75f31274ba0da466901501383 (diff)
downloadgcc-6d4e4fbcd2f5c5a73d263c4f45b0438d7dec9492.zip
gcc-6d4e4fbcd2f5c5a73d263c4f45b0438d7dec9492.tar.gz
gcc-6d4e4fbcd2f5c5a73d263c4f45b0438d7dec9492.tar.bz2
exp_ch3.adb (Make_Eq_If): If the etype of the _parent component is an interface type then do not generate...
2011-08-30 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Make_Eq_If): If the etype of the _parent component is an interface type then do not generate code to compare this component. Required since they have no components and their equality operator is abstract. From-SVN: r178300
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/exp_ch3.adb10
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9a4bc02..33ee476 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2011-08-30 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch3.adb (Make_Eq_If): If the etype of the _parent component is an
+ interface type then do not generate code to compare this component.
+ Required since they have no components and their equality operator is
+ abstract.
+
2011-08-30 Steve Baird <baird@adacore.com>
* sem_util.ads (Deepest_Type_Access_Level): New function; for the type
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 3f11e0e..b1d9b9c 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -8040,14 +8040,20 @@ package body Exp_Ch3 is
Field_Name := Chars (Defining_Identifier (C));
-- The tags must not be compared: they are not part of the value.
- -- Ditto for the controller component, if present.
+ -- Ditto for parent interfaces because their equality operator is
+ -- abstract.
-- Note also that in the following, we use Make_Identifier for
-- the component names. Use of New_Reference_To to identify the
-- components would be incorrect because the wrong entities for
-- discriminants could be picked up in the private type case.
- if Field_Name /= Name_uTag then
+ if Field_Name = Name_uParent
+ and then Is_Interface (Etype (Defining_Identifier (C)))
+ then
+ null;
+
+ elsif Field_Name /= Name_uTag then
Evolve_Or_Else (Cond,
Make_Op_Ne (Loc,
Left_Opnd =>