This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix profiledbootstrap with ada (PR middle-end/37601)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: charlet at act-europe dot fr, ebotcazou at libertysurf dot fr
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 Oct 2008 19:14:46 +0200
- Subject: [PATCH] Fix profiledbootstrap with ada (PR middle-end/37601)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
coverage.c (as well as tree-mudflap.c) create ARRAY_TYPEs with NULL
TREE_DOMAIN, which upsets the in 4.4 newly added gnat_types_compatible_p.
This patch fixes it on the Ada side, profiledbootstrapped and regtested
on x86_64-linux, all,obj-c++,ada languages, ok for trunk?
2008-10-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37601
* gcc-interface/utils.c (gnat_types_compatible_p): Handle
NULL TYPE_DOMAIN.
--- gcc/ada/gcc-interface/utils.c.jj 2008-10-07 16:17:00.000000000 +0200
+++ gcc/ada/gcc-interface/utils.c 2008-10-13 17:18:43.000000000 +0200
@@ -2444,10 +2444,13 @@ gnat_types_compatible_p (tree t1, tree t
the same component type and the same domain. */
if (code == ARRAY_TYPE
&& TREE_TYPE (t1) == TREE_TYPE (t2)
- && tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (t1)),
- TYPE_MIN_VALUE (TYPE_DOMAIN (t2)))
- && tree_int_cst_equal (TYPE_MAX_VALUE (TYPE_DOMAIN (t1)),
- TYPE_MAX_VALUE (TYPE_DOMAIN (t2))))
+ && (TYPE_DOMAIN (t1) == TYPE_DOMAIN (t2)
+ || (TYPE_DOMAIN (t1)
+ && TYPE_DOMAIN (t2)
+ && tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (t1)),
+ TYPE_MIN_VALUE (TYPE_DOMAIN (t2)))
+ && tree_int_cst_equal (TYPE_MAX_VALUE (TYPE_DOMAIN (t1)),
+ TYPE_MAX_VALUE (TYPE_DOMAIN (t2))))))
return 1;
/* Padding record types are also compatible if they pad the same
Jakub