aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-07-23 19:53:29 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-07-23 19:53:29 +0000
commit96bba5e69b93ae01d7f49dd1c12c94ddb462c381 (patch)
tree5cb1304c4753378138ad13050630e8b216a0809c /gcc/ada/gcc-interface/utils.c
parent9183bdcf817721420abd4a68de2b6e933347237c (diff)
downloadgcc-96bba5e69b93ae01d7f49dd1c12c94ddb462c381.zip
gcc-96bba5e69b93ae01d7f49dd1c12c94ddb462c381.tar.gz
gcc-96bba5e69b93ae01d7f49dd1c12c94ddb462c381.tar.bz2
utils.c (gnat_types_compatible_p): Revert latest change and recurse only for multidimensional array types instead.
* gcc-interface/utils.c (gnat_types_compatible_p): Revert latest change and recurse only for multidimensional array types instead. From-SVN: r162485
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 541f7bb..7752edb 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -2081,7 +2081,7 @@ gnat_types_compatible_p (tree t1, tree t2)
return 1;
/* Array types are also compatible if they are constrained and have the same
- domain and compatible component types. */
+ domain(s) and the same component type. */
if (code == ARRAY_TYPE
&& (TYPE_DOMAIN (t1) == TYPE_DOMAIN (t2)
|| (TYPE_DOMAIN (t1)
@@ -2090,7 +2090,9 @@ gnat_types_compatible_p (tree t1, tree t2)
TYPE_MIN_VALUE (TYPE_DOMAIN (t2)))
&& tree_int_cst_equal (TYPE_MAX_VALUE (TYPE_DOMAIN (t1)),
TYPE_MAX_VALUE (TYPE_DOMAIN (t2)))))
- && gnat_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))
+ && (TREE_TYPE (t1) == TREE_TYPE (t2)
+ || (TREE_CODE (TREE_TYPE (t1)) == ARRAY_TYPE
+ && gnat_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2)))))
return 1;
/* Padding record types are also compatible if they pad the same