From 936a6fa78adb1daf15cae50649f1413262697dcf Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 4 Mar 2006 18:27:08 +0000 Subject: [PATCH] gigi.h (get_ada_base_type): Delete. * 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. From-SVN: r111711 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/gigi.h | 3 --- gcc/ada/trans.c | 11 +++++------ gcc/ada/utils2.c | 13 ------------- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cc1a4b2f628..56e21e018de 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2006-03-04 Eric Botcazou + + * 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 * uintp.adb (Num_Bits): Handle Uint_Int_First specially. diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index bc7844c8177..e1914e4ac1b 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -671,9 +671,6 @@ extern tree gnat_truthvalue_conversion (tree expr); /* 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 diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 1a9f3f4dc78..30c0fb5dc27 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -5323,7 +5323,6 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, 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 @@ -5415,7 +5414,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, /* 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; @@ -5474,12 +5473,12 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, 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 diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index ee8dec57d43..65837bb0151 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -123,19 +123,6 @@ get_base_type (tree type) 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; -} /* 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 -- 2.30.2