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 cb281b4..992b1e0 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 8c5dc58..51bce2f 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