ada-tree.h (TYPE_EXTRA_SUBTYPE_P): Add internal check.
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 30 Aug 2011 16:46:12 +0000 (16:46 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 30 Aug 2011 16:46:12 +0000 (16:46 +0000)
* 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.

From-SVN: r178335

gcc/ada/ChangeLog
gcc/ada/gcc-interface/ada-tree.h
gcc/ada/gcc-interface/utils2.c

index ffa538714253415f665973af60582b4522f0081c..7159c35c829a4861526fa115e420cbfe05dc2e5e 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-30  Eric Botcazou  <ebotcazou@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.
+
 2011-08-30  Eric Botcazou  <ebotcazou@adacore.com>
 
        * raise-gcc.c: Do not include coretypes.h and tm.h.
index 588c852cd95bb3ede3051da82760ac53e4b05e7a..2d0e6e4945e189a8a10d5089293c6a7d0ac056e7 100644 (file)
@@ -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
index 25e293dd3e6c1115d81a887cc86ffadcf652d0c4..897f328565d63bfb4f316bbaa342538f51fd3a80 100644 (file)
@@ -544,7 +544,7 @@ build_binary_op (enum tree_code op_code, tree result_type,
     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, tree result_type, tree operand)
     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);