utils.c (finish_record_type): Force structural equality checks if the record type...
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 4 Apr 2009 19:11:05 +0000 (19:11 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 4 Apr 2009 19:11:05 +0000 (19:11 +0000)
* gcc-interface/utils.c (finish_record_type): Force structural equality
checks if the record type is discriminated.

From-SVN: r145549

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c

index cb281b4097df5baec046b54e056c84edb28f83ae..992b1e0b6a4a20816e64539f494c2a8c354434f8 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/utils.c (finish_record_type): Force structural equality
+       checks if the record type is discriminated.
+
 2009-03-31  Eric Botcazou  <ebotcazou@adacore.com>
 
        * system-linux-alpha.ads (Functions_Return_By_DSP): Remove.
index 8c5dc5836253d0fce96c31837501263ad251fb39..51bce2fd4197658c8168d241d204558686ed98e5 100644 (file)
@@ -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