Tested on x86_64-suse-linux, applied on the mainline.

2011-08-30  Eric Botcazou  <ebotca...@adacore.com>

        * gcc-interface/ada-tree.h (TYPE_EXTRA_SUBTYPE_P): Add internal check.
        * gcc-interface/utils2.c (build_binary_op): Tighten condition.
        (build_unary_op): Likewise.


-- 
Eric Botcazou
Index: gcc-interface/utils2.c
===================================================================
--- gcc-interface/utils2.c	(revision 178331)
+++ gcc-interface/utils2.c	(working copy)
@@ -544,7 +544,7 @@ build_binary_op (enum tree_code op_code,
     operation_type = TREE_TYPE (TYPE_FIELDS (operation_type));
 
   if (operation_type
-      && !AGGREGATE_TYPE_P (operation_type)
+      && TREE_CODE (operation_type) == INTEGER_TYPE
       && TYPE_EXTRA_SUBTYPE_P (operation_type))
     operation_type = get_base_type (operation_type);
 
@@ -1002,7 +1002,7 @@ build_unary_op (enum tree_code op_code,
     operation_type = TREE_TYPE (TYPE_FIELDS (operation_type));
 
   if (operation_type
-      && !AGGREGATE_TYPE_P (operation_type)
+      && TREE_CODE (operation_type) == INTEGER_TYPE
       && TYPE_EXTRA_SUBTYPE_P (operation_type))
     operation_type = get_base_type (operation_type);
 
Index: gcc-interface/ada-tree.h
===================================================================
--- gcc-interface/ada-tree.h	(revision 178331)
+++ gcc-interface/ada-tree.h	(working copy)
@@ -106,7 +106,7 @@ do {							 \
 
 /* Nonzero in an arithmetic subtype if this is a subtype not known to the
    front-end.  */
-#define TYPE_EXTRA_SUBTYPE_P(NODE) TYPE_LANG_FLAG_2 (NODE)
+#define TYPE_EXTRA_SUBTYPE_P(NODE) TYPE_LANG_FLAG_2 (INTEGER_TYPE_CHECK (NODE))
 
 /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is the
    type for an object whose type includes its template in addition to

Reply via email to