aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:11:02 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:11:02 +0000
commitb0567726a311d3f2fcec5b62380675231cd610c9 (patch)
tree7e4249e2fdac3895eaf6915bd78daf01006bc4c0 /gcc/cfgexpand.c
parentb4206259f10455603e0c90825566de1ea777c04a (diff)
downloadgcc-b0567726a311d3f2fcec5b62380675231cd610c9.zip
gcc-b0567726a311d3f2fcec5b62380675231cd610c9.tar.gz
gcc-b0567726a311d3f2fcec5b62380675231cd610c9.tar.bz2
[21/77] Replace SCALAR_INT_MODE_P checks with is_a <scalar_int_mode>
This patch replaces checks of "SCALAR_INT_MODE_P (...)" with "is_a <scalar_int_mode> (..., &var)" in cases where it becomes useful to refer to the mode as a scalar_int_mode. It also replaces some checks for the two constituent classes (MODE_INT and MODE_PARTIAL_INT). The patch also introduces is_a <scalar_int_mode> checks for some uses of HWI_COMPUTABLE_MODE_P, which is a subcondition of SCALAR_INT_MODE_P. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * wide-int.h (int_traits<unsigned char>) New class. (int_traits<unsigned short>) Likewise. * cfgexpand.c (expand_debug_expr): Use is_a <scalar_int_mode>. Use GET_MODE_UNIT_PRECISION and remove redundant test for SCALAR_INT_MODE_P. * combine.c (set_nonzero_bits_and_sign_copies): Use is_a <scalar_int_mode>. (find_split_point): Likewise. (combine_simplify_rtx): Likewise. (simplify_logical): Likewise. (expand_compound_operation): Likewise. (expand_field_assignment): Likewise. (make_compound_operation): Likewise. (extended_count): Likewise. (change_zero_ext): Likewise. (simplify_comparison): Likewise. * dwarf2out.c (scompare_loc_descriptor): Likewise. (ucompare_loc_descriptor): Likewise. (minmax_loc_descriptor): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. * expmed.c (init_expmed_one_mode): Likewise. * lra-constraints.c (lra_constraint_offset): Likewise. * optabs.c (prepare_libcall_arg): Likewise. * postreload.c (move2add_note_store): Likewise. * reload.c (operands_match_p): Likewise. * rtl.h (load_extend_op): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * simplify-rtx.c (simplify_truncation): Likewise. (simplify_unary_operation_1): Likewise. (simplify_binary_operation_1): Likewise. (simplify_const_binary_operation): Likewise. (simplify_const_relational_operation): Likewise. (simplify_subreg): Likewise. * stor-layout.c (bitwise_mode_for_mode): Likewise. * var-tracking.c (adjust_mems): Likewise. (prepare_call_arguments): Likewise. gcc/ada/ * gcc-interface/decl.c (check_ok_for_atomic_type): Use is_a <scalar_int_mode>. * gcc-interface/trans.c (Pragma_to_gnu): Likewise. * gcc-interface/utils.c (gnat_type_for_mode): Likewise. gcc/fortran/ * trans-types.c (gfc_type_for_mode): Use is_a <scalar_int_mode>. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251473
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 7a90b0e..ec242bb 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4139,6 +4139,7 @@ expand_debug_expr (tree exp)
machine_mode inner_mode = VOIDmode;
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
addr_space_t as;
+ scalar_int_mode op1_mode;
switch (TREE_CODE_CLASS (TREE_CODE (exp)))
{
@@ -4188,16 +4189,10 @@ expand_debug_expr (tree exp)
case WIDEN_LSHIFT_EXPR:
/* Ensure second operand isn't wider than the first one. */
inner_mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)));
- if (SCALAR_INT_MODE_P (inner_mode))
- {
- machine_mode opmode = mode;
- if (VECTOR_MODE_P (mode))
- opmode = GET_MODE_INNER (mode);
- if (SCALAR_INT_MODE_P (opmode)
- && (GET_MODE_PRECISION (opmode)
- < GET_MODE_PRECISION (inner_mode)))
- op1 = lowpart_subreg (opmode, op1, inner_mode);
- }
+ if (is_a <scalar_int_mode> (inner_mode, &op1_mode)
+ && (GET_MODE_UNIT_PRECISION (mode)
+ < GET_MODE_PRECISION (op1_mode)))
+ op1 = lowpart_subreg (GET_MODE_INNER (mode), op1, op1_mode);
break;
default:
break;