diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-15 09:11:40 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-15 09:11:40 +0000 |
commit | a9538d681b63fb9ff2291c3fde1ddd1ab389576c (patch) | |
tree | faaa7bb6c0694f3f9cf8d8dbe54a58161ef0489f /gcc/tree-vrp.c | |
parent | 7739b9657f038bd8dce5417ab9af6b5abf9e47a7 (diff) | |
download | gcc-a9538d681b63fb9ff2291c3fde1ddd1ab389576c.tar.gz |
* dbxout.c (dbxout_range_type): Add LOW and HIGH parameters. Use them
for bounds.
(print_int_cst_bounds_in_octal_p): Likewise.
(dbxout_type): Adjust calls to above functions. Be prepared to deal
with subtypes.
* dwarf2out.c (base_type_die): Likewise.
(is_subrange_type): Delete.
(subrange_type_die): Add LOW and HIGH parameters. Use them for bounds.
(modified_type_die): Call subrange_type_for_debug_p on subtypes.
* fold-const.c (fold_truth_not_expr) <CONVERT_EXPR>: Do not strip it if
the destination type is boolean.
(build_range_check): Do not special-case subtypes.
(fold_sign_changed_comparison): Likewise.
(fold_unary): Likewise.
* langhooks-def.h (LANG_HOOKS_GET_SUBRANGE_BOUNDS): Define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_GET_SUBRANGE_BOUNDS.
* langhooks.h (lang_hooks_for_types): Add get_subrange_bounds.
* tree.c (subrange_type_for_debug_p): New predicate based on the former
is_subrange_type.
* tree.h (subrange_type_for_debug_p): Declare.
* tree-chrec.c (avoid_arithmetics_in_type_p): Delete.
(convert_affine_scev): Remove call to above function.
(chrec_convert_aggressive): Likewise.
* tree-ssa.c (useless_type_conversion_p_1): Do not specifically return
false for conversions involving subtypes.
* tree-vrp.c (vrp_val_max): Do not special-case subtypes.
(vrp_val_min): Likewise.
(needs_overflow_infinity): Likewise.
(extract_range_from_unary_expr): Likewise.
ada/
* gcc-interface/ada-tree.h (TYPE_GCC_MIN_VALUE, TYPE_GCC_MAX_VALUE):
New macros.
(TYPE_RM_VALUES): Likewise.
(TYPE_RM_SIZE): Rewrite in terms of TYPE_RM_VALUES.
(SET_TYPE_RM_SIZE): New macro.
(TYPE_RM_MIN_VALUE, TYPE_RM_MAX_VALUE): Likewise.
(SET_TYPE_RM_SIZE, SET_TYPE_RM_MAX_VALUE): Likewise.
(TYPE_MIN_VALUE, TYPE_MAX_VALUE): Redefine.
* gcc-interface/gigi.h (create_range_type): Declare.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>
Use SET_TYPE_RM_MAX_VALUE to set the upper bound on the UMT type.
<E_Signed_Integer_Subtype>: Build a regular integer type first and
then set the RM bounds. Use SET_TYPE_RM_SIZE to set the RM size.
<E_Floating_Point_Subtype>: Build a regular floating-point type first
and then set the RM bounds.
<E_Array_Type>: Use create_range_type instead of build_range_type.
<E_Array_Subtype>: Build a regular integer type first and then set
the RM bounds for the extra subtype.
<E_String_Literal_Subtype>: Use create_range_type instead of
build_range_type.
<all>: Set the RM bounds for enumeration types and the GCC bounds for
floating-point types.
(set_rm_size): Use SET_TYPE_RM_SIZE to set the RM size.
(make_type_from_size) <INTEGER_TYPE>: Use SET_TYPE_RM_{MIN,MAX}_VALUE
to set the bounds. Use SET_TYPE_RM_SIZE to set the RM size.
(substitute_in_type) <INTEGER_TYPE>: Deal with GCC bounds for domain
types and with RM bounds for subtypes.
* gcc-interface/misc.c (LANG_HOOKS_GET_SUBRANGE_BOUNDS): Define.
(gnat_print_type) <REAL_TYPE>: New case.
<ENUMERAL_TYPE>: Fall through to above case.
(gnat_get_subrange_bounds): New function.
* gcc-interface/trans.c (add_decl_expr): Mark the trees rooted as
TYPE_RM_MIN_VALUE and TYPE_RM_MAX_VALUE, if any.
* gcc-interface/utils.c (gnat_init_decl_processing): Use precision 8
for booleans. Adjust and use SET_TYPE_RM_SIZE to set the RM size.
(create_range_type): New function.
(create_param_decl): Build a regular integer type first and then set
the RM bounds for the extra subtype.
(unchecked_convert): Remove kludge for 'Valid.
* gcc-interface/utils2.c (build_binary_op) <ARRAY_RANGE_REF>: Convert
the index to sizetype instead of TYPE_DOMAIN.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147563 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 3a86b826e50..a0f4c3d2f3a 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -121,7 +121,7 @@ DEF_VEC_ALLOC_O(switch_update, heap); static VEC (switch_update, heap) *to_update_switch_stmts; -/* Return the maximum value for TYPEs base type. */ +/* Return the maximum value for TYPE. */ static inline tree vrp_val_max (const_tree type) @@ -129,14 +129,10 @@ vrp_val_max (const_tree type) if (!INTEGRAL_TYPE_P (type)) return NULL_TREE; - /* For integer sub-types the values for the base type are relevant. */ - if (TREE_TYPE (type)) - type = TREE_TYPE (type); - return TYPE_MAX_VALUE (type); } -/* Return the minimum value for TYPEs base type. */ +/* Return the minimum value for TYPE. */ static inline tree vrp_val_min (const_tree type) @@ -144,10 +140,6 @@ vrp_val_min (const_tree type) if (!INTEGRAL_TYPE_P (type)) return NULL_TREE; - /* For integer sub-types the values for the base type are relevant. */ - if (TREE_TYPE (type)) - type = TREE_TYPE (type); - return TYPE_MIN_VALUE (type); } @@ -188,11 +180,7 @@ vrp_val_is_min (const_tree val) static inline bool needs_overflow_infinity (const_tree type) { - return (INTEGRAL_TYPE_P (type) - && !TYPE_OVERFLOW_WRAPS (type) - /* Integer sub-types never overflow as they are never - operands of arithmetic operators. */ - && !(TREE_TYPE (type) && TREE_TYPE (type) != type)); + return INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type); } /* Return whether TYPE can support our overflow infinity @@ -2702,13 +2690,6 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code, tree inner_type = TREE_TYPE (op0); tree outer_type = type; - /* Always use base-types here. This is important for the - correct signedness. */ - if (TREE_TYPE (inner_type)) - inner_type = TREE_TYPE (inner_type); - if (TREE_TYPE (outer_type)) - outer_type = TREE_TYPE (outer_type); - /* If VR0 is varying and we increase the type precision, assume a full range for the following transformation. */ if (vr0.type == VR_VARYING |