diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-12-19 18:11:57 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-12-19 18:11:57 +0100 |
commit | 01512446fea2a4564297db1b6ff7632370bd6728 (patch) | |
tree | 96a404bd26176e24281ab6e7f8e47df5a4bb34d1 /gcc/fold-const.c | |
parent | 3a3a8086bed05ffc8d24bb6908e4437bd9e982f7 (diff) | |
download | gcc-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/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 2a08010..89a9f40 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5409,10 +5409,10 @@ fold_range_test (location_t loc, enum tree_code code, tree type, if ((lhs == 0 || rhs == 0 || operand_equal_p (lhs, rhs, 0)) && merge_ranges (&in_p, &low, &high, in0_p, low0, high0, in1_p, low1, high1) - && 0 != (tem = (build_range_check (loc, type, - lhs != 0 ? lhs - : rhs != 0 ? rhs : integer_zero_node, - in_p, low, high)))) + && (tem = (build_range_check (loc, type, + lhs != 0 ? lhs + : rhs != 0 ? rhs : integer_zero_node, + in_p, low, high))) != 0) { if (strict_overflow_p) fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_COMPARISON); @@ -5442,12 +5442,12 @@ fold_range_test (location_t loc, enum tree_code code, tree type, { tree common = save_expr (lhs); - if (0 != (lhs = build_range_check (loc, type, common, - or_op ? ! in0_p : in0_p, - low0, high0)) - && (0 != (rhs = build_range_check (loc, type, common, - or_op ? ! in1_p : in1_p, - low1, high1)))) + if ((lhs = build_range_check (loc, type, common, + or_op ? ! in0_p : in0_p, + low0, high0)) != 0 + && (rhs = build_range_check (loc, type, common, + or_op ? ! in1_p : in1_p, + low1, high1)) != 0) { if (strict_overflow_p) fold_overflow_warning (warnmsg, @@ -6146,10 +6146,9 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, if ((t2 = fold_convert (TREE_TYPE (op0), c)) != 0 && TREE_CODE (t2) == INTEGER_CST && !TREE_OVERFLOW (t2) - && (0 != (t1 = extract_muldiv (op0, t2, code, - code == MULT_EXPR - ? ctype : NULL_TREE, - strict_overflow_p)))) + && (t1 = extract_muldiv (op0, t2, code, + code == MULT_EXPR ? ctype : NULL_TREE, + strict_overflow_p)) != 0) return t1; break; @@ -6217,10 +6216,9 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, so check for it explicitly here. */ && wi::gtu_p (TYPE_PRECISION (TREE_TYPE (size_one_node)), wi::to_wide (op1)) - && 0 != (t1 = fold_convert (ctype, - const_binop (LSHIFT_EXPR, - size_one_node, - op1))) + && (t1 = fold_convert (ctype, + const_binop (LSHIFT_EXPR, size_one_node, + op1))) != 0 && !TREE_OVERFLOW (t1)) return extract_muldiv (build2 (tcode == LSHIFT_EXPR ? MULT_EXPR : FLOOR_DIV_EXPR, @@ -8040,7 +8038,7 @@ fold_truth_andor (location_t loc, enum tree_code code, tree type, } /* See if we can build a range comparison. */ - if (0 != (tem = fold_range_test (loc, code, type, op0, op1))) + if ((tem = fold_range_test (loc, code, type, op0, op1)) != 0) return tem; if ((code == TRUTH_ANDIF_EXPR && TREE_CODE (arg0) == TRUTH_ORIF_EXPR) @@ -8063,8 +8061,8 @@ fold_truth_andor (location_t loc, enum tree_code code, tree type, lhs is another similar operation, try to merge its rhs with our rhs. Then try to merge our lhs and rhs. */ if (TREE_CODE (arg0) == code - && 0 != (tem = fold_truth_andor_1 (loc, code, type, - TREE_OPERAND (arg0, 1), arg1))) + && (tem = fold_truth_andor_1 (loc, code, type, + TREE_OPERAND (arg0, 1), arg1)) != 0) return fold_build2_loc (loc, code, type, TREE_OPERAND (arg0, 0), tem); if ((tem = fold_truth_andor_1 (loc, code, type, arg0, arg1)) != 0) @@ -9526,8 +9524,8 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, STRIP_NOPS (tree110); STRIP_NOPS (tree111); if (TREE_CODE (tree110) == INTEGER_CST - && 0 == compare_tree_int (tree110, - element_precision (rtype)) + && compare_tree_int (tree110, + element_precision (rtype)) == 0 && operand_equal_p (tree01, tree111, 0)) { tem = build2_loc (loc, (code0 == LSHIFT_EXPR @@ -9548,8 +9546,8 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, STRIP_NOPS (tree111); if (TREE_CODE (tree110) == NEGATE_EXPR && TREE_CODE (tree111) == INTEGER_CST - && 0 == compare_tree_int (tree111, - element_precision (rtype) - 1) + && compare_tree_int (tree111, + element_precision (rtype) - 1) == 0 && operand_equal_p (tree01, TREE_OPERAND (tree110, 0), 0)) { tem = build2_loc (loc, (code0 == LSHIFT_EXPR @@ -9657,12 +9655,12 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, /* Only do something if we found more than two objects. Otherwise, nothing has changed and we risk infinite recursion. */ if (ok - && (2 < ((var0 != 0) + (var1 != 0) - + (minus_var0 != 0) + (minus_var1 != 0) - + (con0 != 0) + (con1 != 0) - + (minus_con0 != 0) + (minus_con1 != 0) - + (lit0 != 0) + (lit1 != 0) - + (minus_lit0 != 0) + (minus_lit1 != 0)))) + && ((var0 != 0) + (var1 != 0) + + (minus_var0 != 0) + (minus_var1 != 0) + + (con0 != 0) + (con1 != 0) + + (minus_con0 != 0) + (minus_con1 != 0) + + (lit0 != 0) + (lit1 != 0) + + (minus_lit0 != 0) + (minus_lit1 != 0)) > 2) { var0 = associate_trees (loc, var0, var1, code, atype); minus_var0 = associate_trees (loc, minus_var0, minus_var1, @@ -9876,8 +9874,8 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, strict_overflow_p = false; if (TREE_CODE (arg1) == INTEGER_CST - && 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE, - &strict_overflow_p))) + && (tem = extract_muldiv (op0, arg1, code, NULL_TREE, + &strict_overflow_p)) != 0) { if (strict_overflow_p) fold_overflow_warning (("assuming signed overflow does not " @@ -10310,8 +10308,8 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, strict_overflow_p = false; if (TREE_CODE (arg1) == INTEGER_CST - && 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE, - &strict_overflow_p))) + && (tem = extract_muldiv (op0, arg1, code, NULL_TREE, + &strict_overflow_p)) != 0) { if (strict_overflow_p) fold_overflow_warning (("assuming signed overflow does not occur " @@ -10328,8 +10326,8 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, case TRUNC_MOD_EXPR: strict_overflow_p = false; if (TREE_CODE (arg1) == INTEGER_CST - && 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE, - &strict_overflow_p))) + && (tem = extract_muldiv (op0, arg1, code, NULL_TREE, + &strict_overflow_p)) != 0) { if (strict_overflow_p) fold_overflow_warning (("assuming signed overflow does not occur " @@ -10982,7 +10980,7 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type, && TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg0) == ABS_EXPR && ! TREE_SIDE_EFFECTS (arg0) - && (0 != (tem = negate_expr (arg1))) + && (tem = negate_expr (arg1)) != 0 && TREE_CODE (tem) == INTEGER_CST && !TREE_OVERFLOW (tem)) return fold_build2_loc (loc, TRUTH_ANDIF_EXPR, type, @@ -12491,10 +12489,9 @@ multiple_of_p (tree type, const_tree top, const_tree bottom) so check for it explicitly here. */ if (wi::gtu_p (TYPE_PRECISION (TREE_TYPE (size_one_node)), wi::to_wide (op1)) - && 0 != (t1 = fold_convert (type, - const_binop (LSHIFT_EXPR, - size_one_node, - op1))) + && (t1 = fold_convert (type, + const_binop (LSHIFT_EXPR, size_one_node, + op1))) != 0 && !TREE_OVERFLOW (t1)) return multiple_of_p (type, t1, bottom); } |