From 63787194e1a9a90650caf40922dc09b31a0501bd Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 4 Apr 2009 19:11:05 +0000 Subject: utils.c (finish_record_type): Force structural equality checks if the record type is discriminated. * gcc-interface/utils.c (finish_record_type): Force structural equality checks if the record type is discriminated. From-SVN: r145549 --- gcc/ada/gcc-interface/utils.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/ada/gcc-interface') diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 8c5dc58..51bce2f 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -977,6 +977,11 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level, if (code == QUAL_UNION_TYPE) nreverse (fieldlist); + /* If the type is discriminated, it can be used to access all its + constrained subtypes, so force structural equality checks. */ + if (CONTAINS_PLACEHOLDER_P (size)) + SET_TYPE_STRUCTURAL_EQUALITY (record_type); + if (rep_level < 2) { /* If this is a padding record, we never want to make the size smaller -- cgit v1.1