From 2be65d9e98a1335e0d948c2de59946e715afcbe5 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 21 Aug 2017 14:50:56 +0000 Subject: Add a type_has_mode_precision_p helper function ...to replace instances of: TYPE_PRECISION (t) == GET_MODE_PRECISION (TYPE_MODE (t)) These conditions would need to be rewritten with variable-sized modes anyway. 2017-08-21 Richard Sandiford gcc/ * tree.h (type_has_mode_precision_p): New function. * convert.c (convert_to_integer_1): Use it. * expr.c (expand_expr_real_2): Likewise. (expand_expr_real_1): Likewise. * fold-const.c (fold_single_bit_test_into_sign_test): Likewise. * match.pd: Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): Likewise. * tree-tailcall.c (process_assignment): Likewise. * tree-vect-loop.c (vectorizable_reduction): Likewise. * tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern) (vect_recog_mult_pattern, vect_recog_divmod_pattern): Likewise. * tree-vect-stmts.c (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. * tree-vrp.c (register_edge_assert_for_2): Likewise. From-SVN: r251231 --- gcc/convert.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/convert.c') diff --git a/gcc/convert.c b/gcc/convert.c index b1a53af..22152ca 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -711,8 +711,7 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) the signed-to-unsigned case the high-order bits have to be cleared. */ if (TYPE_UNSIGNED (type) != TYPE_UNSIGNED (TREE_TYPE (expr)) - && (TYPE_PRECISION (TREE_TYPE (expr)) - != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (expr))))) + && !type_has_mode_precision_p (TREE_TYPE (expr))) code = CONVERT_EXPR; else code = NOP_EXPR; -- cgit v1.1