diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-04-04 19:11:05 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-04-04 19:11:05 +0000 |
commit | 63787194e1a9a90650caf40922dc09b31a0501bd (patch) | |
tree | 598fac2051dbb237479e17097b44b966cdc5a380 /gcc/ada/gcc-interface/utils.c | |
parent | 5eeeac64dc4204103a5e394ab522c2780b2410f7 (diff) | |
download | gcc-63787194e1a9a90650caf40922dc09b31a0501bd.zip gcc-63787194e1a9a90650caf40922dc09b31a0501bd.tar.gz gcc-63787194e1a9a90650caf40922dc09b31a0501bd.tar.bz2 |
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
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 |