This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix profiledbootstrap with ada (PR middle-end/37601)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]