From 673bf5a6b65e51d177d2cf9fc4002171b1f467ab Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 30 Aug 2017 11:11:16 +0000 Subject: [23/77] Replace != VOIDmode checks with is_a This patch replaces some checks against VOIDmode with checks of is_a , in cases where scalar integer modes were the only useful alternatives left. gcc/ 2017-08-30 Richard Sandiford Alan Hayward David Sherwood * cfgexpand.c (expand_debug_expr): Use is_a instead of != VOIDmode. * combine.c (if_then_else_cond): Likewise. (change_zero_ext): Likewise. * dwarf2out.c (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. * rtlanal.c (canonicalize_condition): Likewise. * simplify-rtx.c (simplify_relational_operation_1): Likewise. From-SVN: r251475 --- gcc/simplify-rtx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gcc/simplify-rtx.c') diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index bf8abdb..0c91dbb 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -4829,19 +4829,19 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode, /* (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))) is the same as (zero_extract:SI FOO (const_int 1) BAR). */ - scalar_int_mode int_mode; + scalar_int_mode int_mode, int_cmp_mode; if (code == NE && op1 == const0_rtx && is_int_mode (mode, &int_mode) - && cmp_mode != VOIDmode + && is_a (cmp_mode, &int_cmp_mode) /* ??? Work-around BImode bugs in the ia64 backend. */ && int_mode != BImode - && cmp_mode != BImode - && nonzero_bits (op0, cmp_mode) == 1 + && int_cmp_mode != BImode + && nonzero_bits (op0, int_cmp_mode) == 1 && STORE_FLAG_VALUE == 1) - return GET_MODE_SIZE (int_mode) > GET_MODE_SIZE (cmp_mode) - ? simplify_gen_unary (ZERO_EXTEND, int_mode, op0, cmp_mode) - : lowpart_subreg (int_mode, op0, cmp_mode); + return GET_MODE_SIZE (int_mode) > GET_MODE_SIZE (int_cmp_mode) + ? simplify_gen_unary (ZERO_EXTEND, int_mode, op0, int_cmp_mode) + : lowpart_subreg (int_mode, op0, int_cmp_mode); /* (eq/ne (xor x y) 0) simplifies to (eq/ne x y). */ if ((code == EQ || code == NE) -- cgit v1.1