aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-12-19 18:11:57 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-12-19 18:11:57 +0100
commit01512446fea2a4564297db1b6ff7632370bd6728 (patch)
tree96a404bd26176e24281ab6e7f8e47df5a4bb34d1 /gcc/combine.c
parent3a3a8086bed05ffc8d24bb6908e4437bd9e982f7 (diff)
downloadgcc-01512446fea2a4564297db1b6ff7632370bd6728.zip
gcc-01512446fea2a4564297db1b6ff7632370bd6728.tar.gz
gcc-01512446fea2a4564297db1b6ff7632370bd6728.tar.bz2
read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order conditions.
* read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order conditions. * sel-sched.c (extract_new_fences_from): Likewise. * config/visium/constraints.md (J, K, L): Likewise. * config/visium/predicates.md (const_shift_operand): Likewise. * config/visium/visium.c (visium_legitimize_address, visium_legitimize_reload_address): Likewise. * config/m68k/m68k.c (output_reg_adjust, emit_reg_adjust): Likewise. * config/arm/arm.c (arm_block_move_unaligned_straight): Likewise. * config/avr/constraints.md (Y01, Ym1, Y02, Ym2): Likewise. * config/avr/avr-log.c (avr_vdump, avr_log_set_avr_log, SET_DUMP_DETAIL): Likewise. * config/avr/predicates.md (const_8_16_24_operand): Likewise. * config/avr/avr.c (STR_PREFIX_P, avr_popcount_each_byte, avr_is_casesi_sequence, avr_casei_sequence_check_operands, avr_set_core_architecture, avr_set_current_function, avr_legitimize_reload_address, avr_asm_len, avr_print_operand, output_movqi, output_movsisf, avr_out_plus, avr_out_bitop, avr_out_fract, avr_adjust_insn_length, avr_encode_section_info, avr_2word_insn_p, output_reload_in_const, avr_has_nibble_0xf, avr_map_decompose, avr_fold_builtin): Likewise. * config/avr/driver-avr.c (avr_devicespecs_file): Likewise. * config/avr/gen-avr-mmcu-specs.c (str_prefix_p, print_mcu): Likewise. * config/i386/i386.c (ix86_parse_stringop_strategy_string): Likewise. * config/m32c/m32c-pragma.c (m32c_pragma_memregs): Likewise. * config/m32c/m32c.c (m32c_conditional_register_usage, m32c_address_cost): Likewise. * config/m32c/predicates.md (shiftcount_operand, longshiftcount_operand): Likewise. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/nios2/nios2.c (nios2_handle_custom_fpu_insn_option, can_use_cdx_ldstw): Likewise. * config/nios2/nios2.h (CDX_REG_P): Likewise. * config/cr16/cr16.h (RETURN_ADDR_RTX, REGNO_MODE_OK_FOR_BASE_P): Likewise. * config/cr16/cr16.md (*mov<mode>_double): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/h8300/h8300.c (h8300_rtx_costs, get_shift_alg): Likewise. * config/vax/constraints.md (U06, U08, U16, CN6, S08, S16): Likewise. * config/vax/vax.c (adjacent_operands_p): Likewise. * config/ft32/constraints.md (L, b, KA): Likewise. * config/ft32/ft32.c (ft32_load_immediate, ft32_expand_prologue): Likewise. * cfgexpand.c (expand_stack_alignment): Likewise. * gcse.c (insert_expr_in_table): Likewise. * print-rtl.c (rtx_writer::print_rtx_operand_codes_E_and_V): Likewise. * cgraphunit.c (cgraph_node::expand): Likewise. * ira-build.c (setup_min_max_allocno_live_range_point): Likewise. * emit-rtl.c (add_insn): Likewise. * input.c (dump_location_info): Likewise. * passes.c (NEXT_PASS): Likewise. * read-rtl-function.c (parse_note_insn_name, function_reader::read_rtx_operand_r, function_reader::parse_mem_expr): Likewise. * sched-rgn.c (sched_rgn_init): Likewise. * diagnostic-show-locus.c (layout::show_ruler): Likewise. * combine.c (find_split_point, simplify_if_then_else, force_to_mode, if_then_else_cond, simplify_shift_const_1, simplify_comparison): Likewise. * explow.c (eliminate_constant_term): Likewise. * final.c (leaf_renumber_regs_insn): Likewise. * cfgrtl.c (print_rtl_with_bb): Likewise. * genhooks.c (emit_init_macros): Likewise. * poly-int.h (maybe_ne, maybe_le, maybe_lt): Likewise. * tree-data-ref.c (conflict_fn): Likewise. * selftest.c (assert_streq): Likewise. * expr.c (store_constructor_field, expand_expr_real_1): Likewise. * fold-const.c (fold_range_test, extract_muldiv_1, fold_truth_andor, fold_binary_loc, multiple_of_p): Likewise. * reload.c (push_reload, find_equiv_reg): Likewise. * et-forest.c (et_nca, et_below): Likewise. * dbxout.c (dbxout_symbol_location): Likewise. * reorg.c (relax_delay_slots): Likewise. * dojump.c (do_compare_rtx_and_jump): Likewise. * gengtype-parse.c (type): Likewise. * simplify-rtx.c (simplify_gen_ternary, simplify_gen_relational, simplify_const_relational_operation): Likewise. * reload1.c (do_output_reload): Likewise. * dumpfile.c (get_dump_file_info_by_switch): Likewise. * gengtype.c (type_for_name): Likewise. * gimple-ssa-sprintf.c (format_directive): Likewise. ada/ * gcc-interface/trans.c (Loop_Statement_to_gnu): Replace Yoda conditions with typical order conditions. * gcc-interface/misc.c (gnat_get_array_descr_info, default_pass_by_ref): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise. * adaint.c (__gnat_tmp_name): Likewise. c-family/ * known-headers.cc (get_stdlib_header_for_name): Replace Yoda conditions with typical order conditions. c/ * c-typeck.c (comptypes_internal, function_types_compatible_p, perform_integral_promotions, digest_init): Replace Yoda conditions with typical order conditions. * c-decl.c (check_bitfield_type_and_width): Likewise. cp/ * name-lookup.c (get_std_name_hint): Replace Yoda conditions with typical order conditions. * class.c (check_bitfield_decl): Likewise. * pt.c (convert_template_argument): Likewise. * decl.c (duplicate_decls): Likewise. * typeck.c (commonparms): Likewise. fortran/ * scanner.c (preprocessor_line): Replace Yoda conditions with typical order conditions. * dependency.c (check_section_vs_section): Likewise. * trans-array.c (gfc_conv_expr_descriptor): Likewise. jit/ * jit-playback.c (get_type, playback::compile_to_file::copy_file, playback::context::acquire_mutex): Replace Yoda conditions with typical order conditions. * libgccjit.c (gcc_jit_context_new_struct_type, gcc_jit_struct_set_fields, gcc_jit_context_new_union_type, gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise. * jit-builtins.c (matches_builtin): Likewise. * jit-recording.c (recording::compound_type::set_fields, recording::fields::write_reproducer, recording::rvalue::set_scope, recording::function::validate): Likewise. * jit-logging.c (logger::decref): Likewise. From-SVN: r255831
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index eb737f6..36bd21a 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5083,9 +5083,9 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
is known to be on, this can be converted into a NEG of a shift. */
if (STORE_FLAG_VALUE == -1 && XEXP (SET_SRC (x), 1) == const0_rtx
&& GET_MODE (SET_SRC (x)) == GET_MODE (XEXP (SET_SRC (x), 0))
- && 1 <= (pos = exact_log2
- (nonzero_bits (XEXP (SET_SRC (x), 0),
- GET_MODE (XEXP (SET_SRC (x), 0))))))
+ && ((pos = exact_log2 (nonzero_bits (XEXP (SET_SRC (x), 0),
+ GET_MODE (XEXP (SET_SRC (x),
+ 0))))) >= 1))
{
machine_mode mode = GET_MODE (XEXP (SET_SRC (x), 0));
@@ -6680,7 +6680,7 @@ simplify_if_then_else (rtx x)
&& XEXP (cond, 1) == const0_rtx
&& false_rtx == const0_rtx
&& CONST_INT_P (true_rtx)
- && ((1 == nonzero_bits (XEXP (cond, 0), int_mode)
+ && ((nonzero_bits (XEXP (cond, 0), int_mode) == 1
&& (i = exact_log2 (UINTVAL (true_rtx))) >= 0)
|| ((num_sign_bit_copies (XEXP (cond, 0), int_mode)
== GET_MODE_PRECISION (int_mode))
@@ -8637,9 +8637,9 @@ force_to_mode (rtx x, machine_mode mode, unsigned HOST_WIDE_INT mask,
if (GET_CODE (x) == SUBREG
&& subreg_lowpart_p (x)
&& (partial_subreg_p (x)
- || (0 == (mask
- & GET_MODE_MASK (GET_MODE (x))
- & ~GET_MODE_MASK (GET_MODE (SUBREG_REG (x)))))))
+ || (mask
+ & GET_MODE_MASK (GET_MODE (x))
+ & ~GET_MODE_MASK (GET_MODE (SUBREG_REG (x)))) == 0))
return force_to_mode (SUBREG_REG (x), mode, mask, next_select);
scalar_int_mode int_mode, xmode;
@@ -9328,8 +9328,8 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse)
/* If X is a SUBREG, we can narrow both the true and false values
if the inner expression, if there is a condition. */
else if (code == SUBREG
- && 0 != (cond0 = if_then_else_cond (SUBREG_REG (x),
- &true0, &false0)))
+ && (cond0 = if_then_else_cond (SUBREG_REG (x), &true0,
+ &false0)) != 0)
{
true0 = simplify_gen_subreg (mode, true0,
GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
@@ -10928,8 +10928,8 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode,
shift_unit_mode wider than result_mode. */
&& !(code == ASHIFTRT && GET_CODE (varop) == XOR
&& int_result_mode != shift_unit_mode
- && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
- shift_unit_mode))
+ && trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
+ shift_unit_mode) < 0)
&& (new_rtx = simplify_const_binary_operation
(code, int_result_mode,
gen_int_mode (INTVAL (XEXP (varop, 1)), int_result_mode),
@@ -10949,10 +10949,10 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode,
(ashiftrt (xor)) where we've widened the shift and the constant
changes the sign bit. */
if (CONST_INT_P (XEXP (varop, 1))
- && !(code == ASHIFTRT && GET_CODE (varop) == XOR
- && int_result_mode != shift_unit_mode
- && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
- shift_unit_mode)))
+ && !(code == ASHIFTRT && GET_CODE (varop) == XOR
+ && int_result_mode != shift_unit_mode
+ && trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
+ shift_unit_mode) < 0))
{
rtx lhs = simplify_shift_const (NULL_RTX, code, shift_unit_mode,
XEXP (varop, 0), count);
@@ -11061,10 +11061,10 @@ simplify_shift_const_1 (enum rtx_code code, machine_mode result_mode,
else if ((code == ASHIFTRT || code == LSHIFTRT)
&& count < HOST_BITS_PER_WIDE_INT
&& HWI_COMPUTABLE_MODE_P (int_result_mode)
- && 0 == (nonzero_bits (XEXP (varop, 0), int_result_mode)
- >> count)
- && 0 == (nonzero_bits (XEXP (varop, 0), int_result_mode)
- & nonzero_bits (XEXP (varop, 1), int_result_mode)))
+ && (nonzero_bits (XEXP (varop, 0), int_result_mode)
+ >> count) == 0
+ && (nonzero_bits (XEXP (varop, 0), int_result_mode)
+ & nonzero_bits (XEXP (varop, 1), int_result_mode)) == 0)
{
varop = XEXP (varop, 1);
continue;
@@ -12000,10 +12000,10 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
&& HWI_COMPUTABLE_MODE_P (GET_MODE (SUBREG_REG (inner_op0)))
&& (GET_MODE (SUBREG_REG (inner_op0))
== GET_MODE (SUBREG_REG (inner_op1)))
- && (0 == ((~c0) & nonzero_bits (SUBREG_REG (inner_op0),
- GET_MODE (SUBREG_REG (inner_op0)))))
- && (0 == ((~c1) & nonzero_bits (SUBREG_REG (inner_op1),
- GET_MODE (SUBREG_REG (inner_op1))))))
+ && ((~c0) & nonzero_bits (SUBREG_REG (inner_op0),
+ GET_MODE (SUBREG_REG (inner_op0)))) == 0
+ && ((~c1) & nonzero_bits (SUBREG_REG (inner_op1),
+ GET_MODE (SUBREG_REG (inner_op1)))) == 0)
{
op0 = SUBREG_REG (inner_op0);
op1 = SUBREG_REG (inner_op1);
@@ -12339,8 +12339,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
&& (equality_comparison_p || unsigned_comparison_p)
/* (A - C1) zero-extends if it is positive and sign-extends
if it is negative, C2 both zero- and sign-extends. */
- && ((0 == (nonzero_bits (a, inner_mode)
- & ~GET_MODE_MASK (mode))
+ && (((nonzero_bits (a, inner_mode)
+ & ~GET_MODE_MASK (mode)) == 0
&& const_op >= 0)
/* (A - C1) sign-extends if it is positive and 1-extends
if it is negative, C2 both sign- and 1-extends. */
@@ -12408,8 +12408,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
this for equality comparisons due to pathological cases involving
overflows. */
if (equality_comparison_p
- && 0 != (tem = simplify_binary_operation (MINUS, mode,
- op1, XEXP (op0, 1))))
+ && (tem = simplify_binary_operation (MINUS, mode,
+ op1, XEXP (op0, 1))) != 0)
{
op0 = XEXP (op0, 0);
op1 = tem;
@@ -12437,8 +12437,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
this for equality comparisons due to pathological cases involving
overflows. */
if (equality_comparison_p
- && 0 != (tem = simplify_binary_operation (PLUS, mode,
- XEXP (op0, 1), op1)))
+ && (tem = simplify_binary_operation (PLUS, mode,
+ XEXP (op0, 1), op1)) != 0)
{
op0 = XEXP (op0, 0);
op1 = tem;
@@ -12446,8 +12446,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
}
if (equality_comparison_p
- && 0 != (tem = simplify_binary_operation (MINUS, mode,
- XEXP (op0, 0), op1)))
+ && (tem = simplify_binary_operation (MINUS, mode,
+ XEXP (op0, 0), op1)) != 0)
{
op0 = XEXP (op0, 1);
op1 = tem;
@@ -12471,8 +12471,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
/* (eq (xor A B) C) -> (eq A (xor B C)). This is a simplification
if C is zero or B is a constant. */
if (equality_comparison_p
- && 0 != (tem = simplify_binary_operation (XOR, mode,
- XEXP (op0, 1), op1)))
+ && (tem = simplify_binary_operation (XOR, mode,
+ XEXP (op0, 1), op1)) != 0)
{
op0 = XEXP (op0, 0);
op1 = tem;