From: Eric Botcazou Date: Sat, 4 Apr 2009 19:11:05 +0000 (+0000) Subject: utils.c (finish_record_type): Force structural equality checks if the record type... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63787194e1a9a90650caf40922dc09b31a0501bd;p=platform%2Fupstream%2Fgcc.git 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cb281b4..992b1e0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-04-04 Eric Botcazou + + * gcc-interface/utils.c (finish_record_type): Force structural equality + checks if the record type is discriminated. + 2009-03-31 Eric Botcazou * system-linux-alpha.ads (Functions_Return_By_DSP): Remove. 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