+2006-03-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gigi.h (get_ada_base_type): Delete.
+ * utils2.c (get_ada_base_type): Likewise.
+ * trans.c (convert_with_check): Operate in the real base type.
+
2006-03-03 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* uintp.adb (Num_Bits): Handle Uint_Int_First specially.
/* Return the base type of TYPE. */
extern tree get_base_type (tree type);
-/* Likewise, but only return types known at Ada source. */
-extern tree get_ada_base_type (tree type);
-
/* EXP is a GCC tree representing an address. See if we can find how
strictly the object at that address is aligned. Return that alignment
strictly the object at that address is aligned. Return that alignment
tree gnu_in_type = TREE_TYPE (gnu_expr);
tree gnu_in_basetype = get_base_type (gnu_in_type);
tree gnu_base_type = get_base_type (gnu_type);
- tree gnu_ada_base_type = get_ada_base_type (gnu_type);
tree gnu_result = gnu_expr;
/* If we are not doing any checks, the output is an integral type, and
/* Now convert to the result base type. If this is a non-truncating
float-to-integer conversion, round. */
- if (INTEGRAL_TYPE_P (gnu_ada_base_type) && FLOAT_TYPE_P (gnu_in_basetype)
+ if (INTEGRAL_TYPE_P (gnu_base_type) && FLOAT_TYPE_P (gnu_in_basetype)
&& !truncatep)
{
REAL_VALUE_TYPE half_minus_pred_half, pred_half;
gnu_add_pred_half, gnu_subtract_pred_half);
}
- if (TREE_CODE (gnu_ada_base_type) == INTEGER_TYPE
- && TYPE_HAS_ACTUAL_BOUNDS_P (gnu_ada_base_type)
+ if (TREE_CODE (gnu_base_type) == INTEGER_TYPE
+ && TYPE_HAS_ACTUAL_BOUNDS_P (gnu_base_type)
&& TREE_CODE (gnu_result) == UNCONSTRAINED_ARRAY_REF)
- gnu_result = unchecked_convert (gnu_ada_base_type, gnu_result, false);
+ gnu_result = unchecked_convert (gnu_base_type, gnu_result, false);
else
- gnu_result = convert (gnu_ada_base_type, gnu_result);
+ gnu_result = convert (gnu_base_type, gnu_result);
/* Finally, do the range check if requested. Note that if the
result type is a modular type, the range check is actually
return type;
}
-
-/* Likewise, but only return types known to the Ada source. */
-tree
-get_ada_base_type (tree type)
-{
- while (TREE_TYPE (type)
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == REAL_TYPE)
- && !TYPE_EXTRA_SUBTYPE_P (type))
- type = TREE_TYPE (type);
-
- return type;
-}
\f
/* EXP is a GCC tree representing an address. See if we can find how
strictly the object at that address is aligned. Return that alignment