]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* read-rtl.c (parse_reg_note_name): Replace Yoda conditions with
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Dec 2017 17:11:57 +0000 (17:11 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Dec 2017 17:11:57 +0000 (17:11 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255831 138bc75d-0d04-0410-961f-82ee72b054a4

87 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/adaint.c
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/misc.c
gcc/ada/gcc-interface/trans.c
gcc/c-family/ChangeLog
gcc/c-family/known-headers.cc
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-typeck.c
gcc/cfgexpand.c
gcc/cfgrtl.c
gcc/cgraphunit.c
gcc/combine.c
gcc/config/arm/arm.c
gcc/config/avr/avr-log.c
gcc/config/avr/avr.c
gcc/config/avr/constraints.md
gcc/config/avr/driver-avr.c
gcc/config/avr/gen-avr-mmcu-specs.c
gcc/config/avr/predicates.md
gcc/config/cr16/cr16.c
gcc/config/cr16/cr16.h
gcc/config/cr16/cr16.md
gcc/config/ft32/constraints.md
gcc/config/ft32/ft32.c
gcc/config/h8300/h8300.c
gcc/config/i386/i386.c
gcc/config/iq2000/iq2000.c
gcc/config/m32c/m32c-pragma.c
gcc/config/m32c/m32c.c
gcc/config/m32c/predicates.md
gcc/config/m68k/m68k.c
gcc/config/nios2/nios2.c
gcc/config/nios2/nios2.h
gcc/config/vax/constraints.md
gcc/config/vax/vax.c
gcc/config/visium/constraints.md
gcc/config/visium/predicates.md
gcc/config/visium/visium.c
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/pt.c
gcc/cp/typeck.c
gcc/dbxout.c
gcc/diagnostic-show-locus.c
gcc/dojump.c
gcc/dumpfile.c
gcc/emit-rtl.c
gcc/et-forest.c
gcc/explow.c
gcc/expr.c
gcc/final.c
gcc/fold-const.c
gcc/fortran/ChangeLog
gcc/fortran/dependency.c
gcc/fortran/scanner.c
gcc/fortran/trans-array.c
gcc/gcse.c
gcc/gengtype-parse.c
gcc/gengtype.c
gcc/genhooks.c
gcc/gimple-ssa-sprintf.c
gcc/input.c
gcc/ira-build.c
gcc/jit/ChangeLog
gcc/jit/jit-builtins.c
gcc/jit/jit-logging.c
gcc/jit/jit-playback.c
gcc/jit/jit-recording.c
gcc/jit/libgccjit.c
gcc/passes.c
gcc/poly-int.h
gcc/print-rtl.c
gcc/read-rtl-function.c
gcc/read-rtl.c
gcc/reload.c
gcc/reload1.c
gcc/reorg.c
gcc/sched-rgn.c
gcc/sel-sched.c
gcc/selftest.c
gcc/simplify-rtx.c
gcc/tree-data-ref.c

index 76dbd695718ad47d9127d8f38bae375767c479f2..c5146d7518b6e6b770ccf81a78fb58d5d119020c 100644 (file)
@@ -1,3 +1,86 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2017-12-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/82975
index 068255b33b76ae53f4853cb113960bcd8f0b89a2..e9f217346ad669a9de0ac63e8c8a4cf25375a0e3 100644 (file)
@@ -1,3 +1,12 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2017-12-19  Arnaud Charlet  <charlet@adacore.com>
 
        PR ada/66205
index cb0f4bb93b0b579d4ba2561086d5486aad49a366..19fe957c40815e375852767bd917e1c45661e1a9 100644 (file)
@@ -1221,7 +1221,7 @@ __gnat_tmp_name (char *tmp_filename)
 
       /* Fill up the name buffer from the last position.  */
       seed++;
-      for (t = seed; 0 <= --index; t >>= 3)
+      for (t = seed; --index >= 0; t >>= 3)
         *--pos = '0' + (t & 07);
 
       /* Check to see if its unique, if not bump the seed and try again.  */
index b014e687f6def579853fdd9dbcc61a2d10241cd0..84fd588d2387e345f03932d227cfc79de2201f44 100644 (file)
@@ -2111,7 +2111,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
           index to the template.  */
        for (index = (convention_fortran_p ? ndim - 1 : 0),
             gnat_index = First_Index (gnat_entity);
-            0 <= index && index < ndim;
+            index >= 0 && index < ndim;
             index += (convention_fortran_p ? - 1 : 1),
             gnat_index = Next_Index (gnat_index))
          {
@@ -2362,7 +2362,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
               gnat_index = First_Index (gnat_entity),
               gnat_base_index
                 = First_Index (Implementation_Base_Type (gnat_entity));
-              0 <= index && index < ndim;
+              index >= 0 && index < ndim;
               index += (convention_fortran_p ? - 1 : 1),
               gnat_index = Next_Index (gnat_index),
               gnat_base_index = Next_Index (gnat_base_index))
index c45be734c32ac87a9beae069b6d728fec97b56f0..3eda489a36d7b7d31603a75712f44745e3c0cce5 100644 (file)
@@ -953,7 +953,7 @@ gnat_get_array_descr_info (const_tree const_type,
      structure.  */
   for (i = (convention_fortran_p ? info->ndimensions - 1 : 0),
        dimen = first_dimen;
-       0 <= i && i < info->ndimensions;
+       i >= 0 && i < info->ndimensions;
        i += (convention_fortran_p ? -1 : 1),
        dimen = TREE_TYPE (dimen))
     {
@@ -1146,8 +1146,8 @@ default_pass_by_ref (tree gnu_type)
 
   if (AGGREGATE_TYPE_P (gnu_type)
       && (!valid_constant_size_p (TYPE_SIZE_UNIT (gnu_type))
-         || 0 < compare_tree_int (TYPE_SIZE_UNIT (gnu_type),
-                                  TYPE_ALIGN (gnu_type))))
+         || compare_tree_int (TYPE_SIZE_UNIT (gnu_type),
+                              TYPE_ALIGN (gnu_type)) > 0))
     return true;
 
   if (pass_by_reference (NULL, TYPE_MODE (gnu_type), gnu_type, true))
index 55638a10c23060a5deee29d37674483d99c0f5ea..7e7bac9aa4a3e5957e42e7b239a7474ecbc478fd 100644 (file)
@@ -3190,7 +3190,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
 
          /* Note that loop unswitching can only be applied a small number of
             times to a given loop (PARAM_MAX_UNSWITCH_LEVEL default to 3).  */
-         if (0 < n_remaining_checks && n_remaining_checks <= 3
+         if (n_remaining_checks > 0 && n_remaining_checks <= 3
              && optimize > 1 && !optimize_size)
            FOR_EACH_VEC_ELT (*gnu_loop_info->checks, i, rci)
              if (rci->invariant_cond != boolean_false_node)
index 820e66aee0e39ca201b5decedbfe0d534d990873..996e7b8eaf5dc2ddf33e81c5dff7556091c74525 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * known-headers.cc (get_stdlib_header_for_name): Replace Yoda
+       conditions with typical order conditions.
+
 2017-12-18  Marek Polacek  <polacek@redhat.com>
 
        * c-warn.c (warn_logical_operator): Return early if -Wlogical-op is
index d4cd39b1063179ed1889d81ee67620927103d0b7..0dc9a92f1a21439f44ac80d1752b2462d34f3e35 100644 (file)
@@ -117,7 +117,7 @@ get_stdlib_header_for_name (const char *name, enum stdlib lib)
   };
   const size_t num_hints = sizeof (hints) / sizeof (hints[0]);
   for (size_t i = 0; i < num_hints; i++)
-    if (0 == strcmp (name, hints[i].name))
+    if (strcmp (name, hints[i].name) == 0)
       return hints[i].header[lib];
   return NULL;
 }
index d486018e3a2b00701de96ded8fe42609e2988018..bfa62268166df891d32fe9f1e11b0fe382f5ecfe 100644 (file)
@@ -1,3 +1,10 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2017-12-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        * c-typeck.c (c_safe_arg_type_equiv_p,
index 7ade2d6436e8d58180f4f5ccb887f7046be20a0d..e37ae17b9e1abae578416e99e3f73e5629d7b5f6 100644 (file)
@@ -5473,7 +5473,7 @@ check_bitfield_type_and_width (location_t loc, tree *type, tree *width,
 
   max_width = TYPE_PRECISION (*type);
 
-  if (0 < compare_tree_int (*width, max_width))
+  if (compare_tree_int (*width, max_width) > 0)
     {
       error_at (loc, "width of %qs exceeds its type", name);
       w = max_width;
index 541fb61ef08b035606ddd7b191b58736b7158ac3..5ae12d9c8a987690f748742a025ea9396fd6dd3b 100644 (file)
@@ -1177,9 +1177,9 @@ comptypes_internal (const_tree type1, const_tree type2, bool *enum_and_int_p,
 
        /* Target types must match incl. qualifiers.  */
        if (TREE_TYPE (t1) != TREE_TYPE (t2)
-           && 0 == (val = comptypes_internal (TREE_TYPE (t1), TREE_TYPE (t2),
-                                              enum_and_int_p,
-                                              different_types_p)))
+           && (val = comptypes_internal (TREE_TYPE (t1), TREE_TYPE (t2),
+                                         enum_and_int_p,
+                                         different_types_p)) == 0)
          return 0;
 
        if (different_types_p != NULL
@@ -1662,8 +1662,8 @@ function_types_compatible_p (const_tree f1, const_tree f2,
         compare that with the other type's arglist.
         If they don't match, ask for a warning (but no error).  */
       if (TYPE_ACTUAL_ARG_TYPES (f1)
-         && 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1),
-                                          enum_and_int_p, different_types_p))
+         && type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1),
+                                     enum_and_int_p, different_types_p) != 1)
        val = 2;
       return val;
     }
@@ -1672,8 +1672,8 @@ function_types_compatible_p (const_tree f1, const_tree f2,
       if (!self_promoting_args_p (args1))
        return 0;
       if (TYPE_ACTUAL_ARG_TYPES (f2)
-         && 1 != type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2),
-                                          enum_and_int_p, different_types_p))
+         && type_lists_compatible_p (args1, TYPE_ACTUAL_ARG_TYPES (f2),
+                                     enum_and_int_p, different_types_p) != 1)
        val = 2;
       return val;
     }
@@ -2121,8 +2121,8 @@ perform_integral_promotions (tree exp)
       && DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1))
       /* If it's thinner than an int, promote it like a
         c_promoting_integer_type_p, otherwise leave it alone.  */
-      && 0 > compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1)),
-                              TYPE_PRECISION (integer_type_node)))
+      && compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1)),
+                          TYPE_PRECISION (integer_type_node)) < 0)
     return convert (integer_type_node, exp);
 
   if (c_promoting_integer_type_p (type))
@@ -7426,15 +7426,14 @@ digest_init (location_t init_loc, tree type, tree init, tree origtype,
              /* Subtract the size of a single (possibly wide) character
                 because it's ok to ignore the terminating null char
                 that is counted in the length of the constant.  */
-             if (0 > compare_tree_int (TYPE_SIZE_UNIT (type),
-                                       (len
-                                        - (TYPE_PRECISION (typ1)
-                                           / BITS_PER_UNIT))))
+             if (compare_tree_int (TYPE_SIZE_UNIT (type),
+                                   (len - (TYPE_PRECISION (typ1)
+                                           / BITS_PER_UNIT))) < 0)
                pedwarn_init (init_loc, 0,
                              ("initializer-string for array of chars "
                               "is too long"));
              else if (warn_cxx_compat
-                      && 0 > compare_tree_int (TYPE_SIZE_UNIT (type), len))
+                      && compare_tree_int (TYPE_SIZE_UNIT (type), len) < 0)
                warning_at (init_loc, OPT_Wc___compat,
                            ("initializer-string for array chars "
                             "is too long for C++"));
index 467bad5dab35f50247b1f8c45e806f689987af1e..85374d32c76a81fda9a838efa704ddd0d069ad38 100644 (file)
@@ -6102,7 +6102,7 @@ expand_stack_alignment (void)
   gcc_assert ((stack_realign_drap != 0) == (drap_rtx != NULL));
 
   /* Do nothing if NULL is returned, which means DRAP is not needed.  */
-  if (NULL != drap_rtx)
+  if (drap_rtx != NULL)
     {
       crtl->args.internal_arg_pointer = drap_rtx;
 
index b127ea1a0b38671b2ceb9c2ad92642c86719abc8..fda9f5d3e131092ab90262b0ab663e28bdcd4ee5 100644 (file)
@@ -2194,7 +2194,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
            }
        }
 
-      for (tmp_rtx = rtx_first; NULL != tmp_rtx; tmp_rtx = NEXT_INSN (tmp_rtx))
+      for (tmp_rtx = rtx_first; tmp_rtx != NULL; tmp_rtx = NEXT_INSN (tmp_rtx))
        {
          if (flags & TDF_BLOCKS)
            {
index dec5c8b5736447360966086c1e6446eb1f170704..901182454c5b77ca5d78abd73a3e328765939a7d 100644 (file)
@@ -2155,8 +2155,8 @@ cgraph_node::expand (void)
 
       if (ret_type && TYPE_SIZE_UNIT (ret_type)
          && TREE_CODE (TYPE_SIZE_UNIT (ret_type)) == INTEGER_CST
-         && 0 < compare_tree_int (TYPE_SIZE_UNIT (ret_type),
-                                  larger_than_size))
+         && compare_tree_int (TYPE_SIZE_UNIT (ret_type),
+                              larger_than_size) > 0)
        {
          unsigned int size_as_int
            = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
index eb737f64002cd53abb5b734dab38d2adeb5e87f8..36bd21ae5ca5d35b89c3df33cf444c5e24fe1a24 100644 (file)
@@ -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;
index 3252f849ad27a5fb4d7699b4a6111afc84479ea8..f914285e16e7213a9d473dfe2c0a05cd556e6773 100644 (file)
@@ -13987,7 +13987,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
   HOST_WIDE_INT src_autoinc, dst_autoinc;
   rtx mem, addr;
   
-  gcc_assert (1 <= interleave_factor && interleave_factor <= 4);
+  gcc_assert (interleave_factor >= 1 && interleave_factor <= 4);
   
   /* Use hard registers if we have aligned source or destination so we can use
      load/store multiple with contiguous registers.  */
index e3a821a484441055103907a36275ba3ddfb1e2e1..d1cf3dd003cc8c550c09f199fa895f84a336a762 100644 (file)
@@ -86,7 +86,7 @@ avr_vdump (FILE *stream, const char *caller, ...)
 {
   va_list ap;
         
-  if (NULL == stream && dump_file)
+  if (stream == NULL && dump_file)
     stream = dump_file;
 
   va_start (ap, caller);
@@ -294,15 +294,15 @@ avr_log_set_avr_log (void)
       str[0] = ',';
       strcat (stpcpy (str+1, avr_log_details), ",");
 
-      all |= NULL != strstr (str, ",all,");
-      info = NULL != strstr (str, ",?,");
+      all |= strstr (str, ",all,") != NULL;
+      info = strstr (str, ",?,") != NULL;
 
       if (info)
         fprintf (stderr, "\n-mlog=");
 
 #define SET_DUMP_DETAIL(S)                                       \
       do {                                                       \
-        avr_log.S = (all || NULL != strstr (str, "," #S ","));   \
+       avr_log.S = (all || strstr (str, "," #S ",") != NULL);   \
         if (info)                                                \
           fprintf (stderr, #S ",");                              \
       } while (0)
index 8a28950dfab11ab0a2c2f940bdd970b63c4e46e7..ff6672fed469db3f05a761f0d4094a8aa3d1026c 100644 (file)
@@ -65,7 +65,7 @@
 #define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE))
 
 /* Return true if STR starts with PREFIX and false, otherwise.  */
-#define STR_PREFIX_P(STR,PREFIX) (0 == strncmp (STR, PREFIX, strlen (PREFIX)))
+#define STR_PREFIX_P(STR,PREFIX) (strncmp (STR, PREFIX, strlen (PREFIX)) == 0)
 
 /* The 4 bits starting at SECTION_MACH_DEP are reserved to store the
    address space where data is to be located.
@@ -269,7 +269,7 @@ avr_popcount_each_byte (rtx xval, int n_bytes, int pop_mask)
       rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
       unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
 
-      if (0 == (pop_mask & (1 << popcount_hwi (val8))))
+      if ((pop_mask & (1 << popcount_hwi (val8))) == 0)
         return false;
     }
 
@@ -461,8 +461,8 @@ avr_is_casesi_sequence (basic_block bb, rtx_insn *insn, rtx_insn *insns[6])
 
   // Assert on the anatomy of xinsn's operands we are going to work with.
 
-  gcc_assert (11 == recog_data.n_operands);
-  gcc_assert (4 == recog_data.n_dups);
+  gcc_assert (recog_data.n_operands == 11);
+  gcc_assert (recog_data.n_dups == 4);
 
   if (dump_file)
     {
@@ -509,7 +509,7 @@ avr_casei_sequence_check_operands (rtx *xop)
 
   if (sub_5
       && SUBREG_P (sub_5)
-      && 0 == SUBREG_BYTE (sub_5)
+      && SUBREG_BYTE (sub_5) == 0
       && rtx_equal_p (xop[5], SUBREG_REG (sub_5)))
     return true;
 
@@ -697,7 +697,7 @@ avr_set_core_architecture (void)
 
   for (const avr_mcu_t *mcu = avr_mcu_types; ; mcu++)
     {
-      if (NULL == mcu->name)
+      if (mcu->name == NULL)
         {
           /* Reached the end of `avr_mcu_types'.  This should actually never
              happen as options are provided by device-specs.  It could be a
@@ -709,9 +709,9 @@ avr_set_core_architecture (void)
           avr_inform_core_architectures ();
           break;
         }
-      else if (0 == strcmp (mcu->name, avr_mmcu)
+      else if (strcmp (mcu->name, avr_mmcu) == 0
                // Is this a proper architecture ?
-               && NULL == mcu->macro)
+              && mcu->macro == NULL)
         {
           avr_arch = &avr_arch_types[mcu->arch_id];
           if (avr_n_flash < 0)
@@ -1109,9 +1109,9 @@ avr_set_current_function (tree decl)
   // Common problem is using "ISR" without first including avr/interrupt.h.
   const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
   name = default_strip_name_encoding (name);
-  if (0 == strcmp ("ISR", name)
-      || 0 == strcmp ("INTERRUPT", name)
-      || 0 == strcmp ("SIGNAL", name))
+  if (strcmp ("ISR", name) == 0
+      || strcmp ("INTERRUPT", name) == 0
+      || strcmp ("SIGNAL", name) == 0)
     {
       warning_at (loc, OPT_Wmisspelled_isr, "%qs is a reserved identifier"
                   " in AVR-LibC.  Consider %<#include <avr/interrupt.h>%>"
@@ -2572,7 +2572,7 @@ avr_legitimize_reload_address (rtx *px, machine_mode mode,
 
   if (GET_CODE (x) == PLUS
       && REG_P (XEXP (x, 0))
-      && 0 == reg_equiv_constant (REGNO (XEXP (x, 0)))
+      && reg_equiv_constant (REGNO (XEXP (x, 0))) == 0
       && CONST_INT_P (XEXP (x, 1))
       && INTVAL (XEXP (x, 1)) >= 1)
     {
@@ -2639,10 +2639,8 @@ avr_legitimize_reload_address (rtx *px, machine_mode mode,
 static const char*
 avr_asm_len (const char* tpl, rtx* operands, int* plen, int n_words)
 {
-  if (NULL == plen)
-    {
-      output_asm_insn (tpl, operands);
-    }
+  if (plen == NULL)
+    output_asm_insn (tpl, operands);
   else
     {
       if (n_words < 0)
@@ -2969,7 +2967,7 @@ avr_print_operand (FILE *file, rtx x, int code)
   else if (code == 'x')
     {
       /* Constant progmem address - like used in jmp or call */
-      if (0 == text_segment_operand (x, VOIDmode))
+      if (text_segment_operand (x, VOIDmode) == 0)
         if (warning (0, "accessing program memory"
                      " with data memory address"))
           {
@@ -3930,7 +3928,7 @@ output_movqi (rtx_insn *insn, rtx operands[], int *plen)
       return avr_out_lpm (insn, operands, plen);
     }
 
-  gcc_assert (1 == GET_MODE_SIZE (GET_MODE (dest)));
+  gcc_assert (GET_MODE_SIZE (GET_MODE (dest)) == 1);
 
   if (REG_P (dest))
     {
@@ -4925,7 +4923,7 @@ output_movsisf (rtx_insn *insn, rtx operands[], int *l)
   if (!l)
     l = &dummy;
 
-  gcc_assert (4 == GET_MODE_SIZE (GET_MODE (dest)));
+  gcc_assert (GET_MODE_SIZE (GET_MODE (dest)) == 4);
 
   if (REG_P (dest))
     {
@@ -8265,7 +8263,7 @@ avr_out_plus (rtx insn, rtx *xop, int *plen, int *pcc, bool out_label)
       return "";
     }
 
-  if (8 == n_bytes)
+  if (n_bytes == 8)
     {
       op[0] = gen_rtx_REG (DImode, ACC_A);
       op[1] = gen_rtx_REG (DImode, ACC_A);
@@ -8383,11 +8381,11 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
         {
         case IOR:
 
-          if (0 == pop8)
+         if (pop8 == 0)
             continue;
           else if (ld_reg_p)
             avr_asm_len ("ori %0,%1", op, plen, 1);
-          else if (1 == pop8)
+         else if (pop8 == 1)
             {
               if (set_t != 1)
                 avr_asm_len ("set", op, plen, 1);
@@ -8396,7 +8394,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
               op[1] = GEN_INT (exact_log2 (val8));
               avr_asm_len ("bld %0,%1", op, plen, 1);
             }
-          else if (8 == pop8)
+         else if (pop8 == 8)
             {
               if (op[3] != NULL_RTX)
                 avr_asm_len ("mov %0,%3", op, plen, 1);
@@ -8419,13 +8417,13 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
 
         case AND:
 
-          if (8 == pop8)
+         if (pop8 == 8)
             continue;
-          else if (0 == pop8)
+         else if (pop8 == 0)
             avr_asm_len ("clr %0", op, plen, 1);
           else if (ld_reg_p)
             avr_asm_len ("andi %0,%1", op, plen, 1);
-          else if (7 == pop8)
+         else if (pop8 == 7)
             {
               if (set_t != 0)
                 avr_asm_len ("clt", op, plen, 1);
@@ -8447,9 +8445,9 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
 
         case XOR:
 
-          if (0 == pop8)
+         if (pop8 == 0)
             continue;
-          else if (8 == pop8)
+         else if (pop8 == 8)
             avr_asm_len ("com %0", op, plen, 1);
           else if (ld_reg_p && val8 == (1 << 7))
             avr_asm_len ("subi %0,%1", op, plen, 1);
@@ -8727,9 +8725,9 @@ avr_out_fract (rtx_insn *insn, rtx operands[], bool intsigned, int *plen)
 
   bool sign_extend = src.sbit && sign_bytes;
 
-  if (0 == dest.fbit % 8 && 7 == src.fbit % 8)
+  if (dest.fbit % 8 == 0 && src.fbit % 8 == 7)
     shift = ASHIFT;
-  else if (7 == dest.fbit % 8 && 0 == src.fbit % 8)
+  else if (dest.fbit % 8 == 7 && src.fbit % 8 == 0)
     shift = ASHIFTRT;
   else if (dest.fbit % 8 == src.fbit % 8)
     shift = UNKNOWN;
@@ -9401,8 +9399,7 @@ avr_adjust_insn_length (rtx_insn *insn, int len)
      It is easier to state this in an insn attribute "adjust_len" than
      to clutter up code here...  */
 
-  if (!NONDEBUG_INSN_P (insn)
-      || -1 == recog_memoized (insn))
+  if (!NONDEBUG_INSN_P (insn) || recog_memoized (insn) == -1)
     {
       return len;
     }
@@ -10265,7 +10262,7 @@ avr_asm_init_sections (void)
      we have also to track .rodata because it is located in RAM then.  */
 
 #if defined HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH
-  if (0 == avr_arch->flash_pm_offset)
+  if (avr_arch->flash_pm_offset == 0)
 #endif
     readonly_data_section->unnamed.callback = avr_output_data_section_asm_op;
   data_section->unnamed.callback = avr_output_data_section_asm_op;
@@ -10303,7 +10300,7 @@ avr_asm_named_section (const char *name, unsigned int flags, tree decl)
 
   if (!avr_need_copy_data_p
 #if defined HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH
-      && 0 == avr_arch->flash_pm_offset
+      && avr_arch->flash_pm_offset == 0
 #endif
       )
     avr_need_copy_data_p = (STR_PREFIX_P (name, ".rodata")
@@ -10439,8 +10436,7 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p)
       /* PSTR strings are in generic space but located in flash:
          patch address space.  */
 
-      if (!AVR_TINY
-          && -1 == avr_progmem_p (decl, attr))
+      if (!AVR_TINY && avr_progmem_p (decl, attr) == -1)
         as = ADDR_SPACE_FLASH;
 
       AVR_SYMBOL_SET_ADDR_SPACE (sym, as);
@@ -10479,7 +10475,7 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p)
       && SYMBOL_REF_P (XEXP (rtl, 0)))
     {
       rtx sym = XEXP (rtl, 0);
-      bool progmem_p = -1 == avr_progmem_p (decl, DECL_ATTRIBUTES (decl));
+      bool progmem_p = avr_progmem_p (decl, DECL_ATTRIBUTES (decl)) == -1;
 
       if (progmem_p)
         {
@@ -12091,9 +12087,7 @@ test_hard_reg_class (enum reg_class rclass, rtx x)
 static bool
 avr_2word_insn_p (rtx_insn *insn)
 {
-  if (TARGET_SKIP_BUG
-      || !insn
-      || 2 != get_attr_length (insn))
+  if (TARGET_SKIP_BUG || !insn || get_attr_length (insn) != 2)
     {
       return false;
     }
@@ -12402,11 +12396,8 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
 
           if (INTVAL (lo16) == INTVAL (hi16))
             {
-              if (0 != INTVAL (lo16)
-                  || !clear_p)
-                {
-                  avr_asm_len ("movw %C0,%A0", &op[0], len, 1);
-                }
+             if (INTVAL (lo16) != 0 || !clear_p)
+               avr_asm_len ("movw %C0,%A0", &op[0], len, 1);
 
               break;
             }
@@ -12458,7 +12449,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
 
       /* Need no clobber reg for -1: Use CLR/DEC */
 
-      if (-1 == ival[n])
+      if (ival[n] == -1)
         {
           if (!clear_p)
             avr_asm_len ("clr %0", &xdest[n], len, 1);
@@ -12466,7 +12457,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
           avr_asm_len ("dec %0", &xdest[n], len, 1);
           continue;
         }
-      else if (1 == ival[n])
+      else if (ival[n] == 1)
         {
           if (!clear_p)
             avr_asm_len ("clr %0", &xdest[n], len, 1);
@@ -13690,7 +13681,7 @@ bool
 avr_has_nibble_0xf (rtx ival)
 {
   unsigned int map = UINTVAL (ival) & GET_MODE_MASK (SImode);
-  return 0 != avr_map_metric (map, MAP_MASK_PREIMAGE_F);
+  return avr_map_metric (map, MAP_MASK_PREIMAGE_F) != 0;
 }
 
 
@@ -13757,7 +13748,7 @@ static const avr_map_op_t avr_map_op[] =
 static avr_map_op_t
 avr_map_decompose (unsigned int f, const avr_map_op_t *g, bool val_const_p)
 {
-  bool val_used_p = 0 != avr_map_metric (f, MAP_MASK_PREIMAGE_F);
+  bool val_used_p = avr_map_metric (f, MAP_MASK_PREIMAGE_F) != 0;
   avr_map_op_t f_ginv = *g;
   unsigned int ginv = g->ginv;
 
@@ -13788,13 +13779,10 @@ avr_map_decompose (unsigned int f, const avr_map_op_t *g, bool val_const_p)
 
   /* Step 2a:  Compute cost of F o G^-1  */
 
-  if (0 == avr_map_metric (f_ginv.map, MAP_NONFIXED_0_7))
-    {
-      /* The mapping consists only of fixed points and can be folded
-         to AND/OR logic in the remainder.  Reasonable cost is 3. */
-
-      f_ginv.cost = 2 + (val_used_p && !val_const_p);
-    }
+  if (avr_map_metric (f_ginv.map, MAP_NONFIXED_0_7) == 0)
+    /* The mapping consists only of fixed points and can be folded
+       to AND/OR logic in the remainder.  Reasonable cost is 3. */
+    f_ginv.cost = 2 + (val_used_p && !val_const_p);
   else
     {
       rtx xop[4];
@@ -14500,7 +14488,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
         map = TREE_INT_CST_LOW (tmap);
 
         if (TREE_CODE (tval) != INTEGER_CST
-            && 0 == avr_map_metric (map, MAP_MASK_PREIMAGE_F))
+           && avr_map_metric (map, MAP_MASK_PREIMAGE_F) == 0)
           {
             /* There are no F in the map, i.e. 3rd operand is unused.
                Replace that argument with some constant to render
@@ -14511,7 +14499,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
           }
 
         if (TREE_CODE (tbits) != INTEGER_CST
-            && 0 == avr_map_metric (map, MAP_PREIMAGE_0_7))
+           && avr_map_metric (map, MAP_PREIMAGE_0_7) == 0)
           {
             /* Similar for the bits to be inserted. If they are unused,
                we can just as well pass 0.  */
@@ -14550,7 +14538,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg,
         /* If bits don't change their position we can use vanilla logic
            to merge the two arguments.  */
 
-        if (0 == avr_map_metric (map, MAP_NONFIXED_0_7))
+       if (avr_map_metric (map, MAP_NONFIXED_0_7) == 0)
           {
             int mask_f = avr_map_metric (map, MAP_MASK_PREIMAGE_F);
             tree tres, tmask = build_int_cst (val_type, mask_f ^ 0xff);
index c4330500acb453d742714c02dff6ae9e3f8cde6f..226c47cefb09fb80b2763e22953929e25bae8524 100644 (file)
 (define_constraint "Y01"
   "Fixed-point or integer constant with bit representation 0x1"
   (ior (and (match_code "const_fixed")
-            (match_test "1 == INTVAL (avr_to_int_mode (op))"))
+           (match_test "INTVAL (avr_to_int_mode (op)) == 1"))
        (match_test "satisfies_constraint_P (op)")))
 
 (define_constraint "Ym1"
   "Fixed-point or integer constant with bit representation -0x1"
   (ior (and (match_code "const_fixed")
-            (match_test "-1 == INTVAL (avr_to_int_mode (op))"))
+           (match_test "INTVAL (avr_to_int_mode (op)) == -1"))
        (match_test "satisfies_constraint_N (op)")))
 
 (define_constraint "Y02"
   "Fixed-point or integer constant with bit representation 0x2"
   (ior (and (match_code "const_fixed")
-            (match_test "2 == INTVAL (avr_to_int_mode (op))"))
+           (match_test "INTVAL (avr_to_int_mode (op)) == 2"))
        (match_test "satisfies_constraint_K (op)")))
 
 (define_constraint "Ym2"
   "Fixed-point or integer constant with bit representation -0x2"
   (ior (and (match_code "const_fixed")
-            (match_test "-2 == INTVAL (avr_to_int_mode (op))"))
+           (match_test "INTVAL (avr_to_int_mode (op)) == -2"))
        (match_test "satisfies_constraint_Cm2 (op)")))
 
 (define_constraint "Yx2"
index fe17e2df151a911a24b1e662dc4a51e619fc14b3..2d3e0d5593bebbcf59cf5f1752c9cc57a7ecde5f 100644 (file)
@@ -59,7 +59,7 @@ avr_devicespecs_file (int argc, const char **argv)
       return X_NODEVLIB;
 
     case 1:
-      if (0 == strcmp ("device-specs", argv[0]))
+      if (strcmp ("device-specs", argv[0]) == 0)
         {
           /* FIXME:  This means "device-specs%s" from avr.h:DRIVER_SELF_SPECS
              has not been resolved to a path.  That case can occur when the
@@ -81,7 +81,7 @@ avr_devicespecs_file (int argc, const char **argv)
       // Allow specifying the same MCU more than once.
 
       for (int i = 2; i < argc; i++)
-        if (0 != strcmp (mmcu, argv[i]))
+       if (strcmp (mmcu, argv[i]) != 0)
           {
             error ("specified option %qs more than once", "-mmcu");
             return X_NODEVLIB;
index e09f3e46502706bf2ef857a3cfcbe8f6144fda3b..08ef1664716fafa411deb23feb6ed6c0ed405f31 100644 (file)
@@ -55,7 +55,7 @@
 static bool
 str_prefix_p (const char *str, const char *prefix)
 {
-  return 0 == strncmp (str, prefix, strlen (prefix));
+  return strncmp (str, prefix, strlen (prefix)) == 0;
 }
 
 
@@ -133,12 +133,12 @@ print_mcu (const avr_mcu_t *mcu)
 
   FILE *f = fopen (name ,"w");
 
-  bool absdata = 0 != (mcu->dev_attribute & AVR_ISA_LDS);
-  bool errata_skip = 0 != (mcu->dev_attribute & AVR_ERRATA_SKIP);
-  bool rmw = 0 != (mcu->dev_attribute & AVR_ISA_RMW);
-  bool sp8 = 0 != (mcu->dev_attribute & AVR_SHORT_SP);
+  bool absdata = (mcu->dev_attribute & AVR_ISA_LDS) != 0;
+  bool errata_skip = (mcu->dev_attribute & AVR_ERRATA_SKIP) != 0;
+  bool rmw = (mcu->dev_attribute & AVR_ISA_RMW) != 0;
+  bool sp8 = (mcu->dev_attribute & AVR_SHORT_SP) != 0;
   bool rcall = (mcu->dev_attribute & AVR_ISA_RCALL);
-  bool is_arch = NULL == mcu->macro;
+  bool is_arch = mcu->macro == NULL;
   bool is_device = ! is_arch;
 
   if (is_arch
index 1959b86de17fd258dad6b81cf5fa47d23015712a..1147005d5120bac1408ee2c07f8b2d87f1246f32 100644 (file)
 ;; 8 or 16 or 24.
 (define_predicate "const_8_16_24_operand"
   (and (match_code "const_int")
-       (match_test "8 == INTVAL(op) || 16 == INTVAL(op) || 24 == INTVAL(op)")))
+       (match_test "INTVAL(op) == 8 || INTVAL(op) == 16 || INTVAL(op) == 24")))
 
 ;; Unsigned CONST_INT that fits in 8 bits, i.e. 0..255.
 (define_predicate "u8_operand"
index 2dd30fad85a8d839ecb36735e890f84c66fb67e4..364fdf49e7efa05bc987cb37906dfc3f164ecbb3 100644 (file)
@@ -1859,10 +1859,10 @@ cr16_create_dwarf_for_multi_push (rtx insn)
 
   for (i = current_frame_info.last_reg_to_save; i >= 0;)
     {
-      if (!current_frame_info.save_regs[i] || 0 == i || split_here)
+      if (!current_frame_info.save_regs[i] || i == 0 || split_here)
        {
          /* This block of regs is pushed in one instruction.  */
-         if (0 == i && current_frame_info.save_regs[i])
+         if (i == 0 && current_frame_info.save_regs[i])
            from = 0;
 
          for (j = to; j >= from; --j)
index b0ad34f70ce24fc7d34659af3656cc7fd51f6387..5c4702c28ef35b19f43c9748ed0ff51306c1ea97 100644 (file)
@@ -233,7 +233,7 @@ while (0)
 /* A C expression whose value is RTL representing the value of the return
    address for the frame COUNT steps up from the current frame.  */
 #define RETURN_ADDR_RTX(COUNT, FRAME)                                  \
-  (0 == COUNT) ?  gen_rtx_PLUS (Pmode, gen_rtx_RA, gen_rtx_RA)         \
+  (COUNT == 0) ?  gen_rtx_PLUS (Pmode, gen_rtx_RA, gen_rtx_RA)         \
                :  const0_rtx
 
 enum reg_class
@@ -293,7 +293,7 @@ enum reg_class
        (CR16_REGNO_OK_FOR_BASE_P(REGNO)  &&      \
          ((GET_MODE_SIZE (MODE) > 4  &&          \
             (REGNO) < CR16_FIRST_DWORD_REGISTER) \
-            ? (0 == ((REGNO) & 1))               \
+            ? (((REGNO) & 1) == 0)               \
             : 1))
 
 /* TODO: For now lets not support index addressing mode.  */
index 2d9f6ca1ce0cf054293e1d230307841ec5c1e14d..25e1041506f994f3035da6163c0808e23da01b76 100644 (file)
    || register_operand (operands[1], DImode)
    || register_operand (operands[1], DFmode)"
   {
-    if (0 == which_alternative) {
-      rtx xoperands[2] ;
+    if (which_alternative == 0) {
+      rtx xoperands[2];
       int reg0 = REGNO (operands[0]);
       int reg1 = REGNO (operands[1]);
 
          output_asm_insn ("movd\t%1, %0", operands);
        }}
 
-    else if (1 == which_alternative) {
-      rtx lo_operands[2] ;
-      rtx hi_operands[2] ;
+    else if (which_alternative == 1) {
+      rtx lo_operands[2];
+      rtx hi_operands[2];
 
       lo_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));
       hi_operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 2);
       output_asm_insn ("movd\t%1, %0", lo_operands);
       output_asm_insn ("movd\t%1, %0", hi_operands);}
 
-    else if (2 == which_alternative) {
-      rtx xoperands[2] ;
-      int reg0 = REGNO (operands[0]), reg1 = -2 ;
-      rtx addr ;
+    else if (which_alternative == 2) {
+      rtx xoperands[2];
+      int reg0 = REGNO (operands[0]), reg1 = -2;
+      rtx addr;
 
        if (MEM_P (operands[1]))
          addr = XEXP (operands[1], 0);
        else
-         addr = NULL_RTX ;
+         addr = NULL_RTX;
        switch (GET_CODE (addr))
          {
            case REG:
            case SUBREG:
              reg1 = REGNO (addr);
-             break ;
+             break;
            case PLUS:
              switch (GET_CODE (XEXP (addr, 0))) {
                case REG:
                case SUBREG:
                  reg1 = REGNO (XEXP (addr, 0));
-                 break ;
+                 break;
                case PLUS:
                  reg1 = REGNO (XEXP (XEXP (addr, 0), 0));
-                 break ;
+                 break;
                default:
                  inform (DECL_SOURCE_LOCATION (cfun->decl), "unexpected expression; addr:");
                  debug_rtx (addr);
                  inform (DECL_SOURCE_LOCATION (cfun->decl), "operands[1]:");
                  debug_rtx (operands[1]);
                  inform (DECL_SOURCE_LOCATION (cfun->decl), "generated code might now work\n");
-                 break ;}
-             break ;
+                 break;}
+             break;
            default:
-             break ;
+             break;
          }
 
        xoperands[0] = gen_rtx_REG (SImode, reg0 + 2);
          }}
     else
       {
-       rtx xoperands[2] ;
+       rtx xoperands[2];
        xoperands[0] = offset_address (operands[0], GEN_INT (4), 2);
        xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 2);
        output_asm_insn ("stord\t%1, %0", operands);
        output_asm_insn ("stord\t%1, %0", xoperands);
       }
-    return "" ;
+    return "";
   }
   [(set_attr "length" "4, <lImmArithD>, <lImmArithD>, <lImmArithD>")]
 )
index 4780315f217e3fb578ea1b59b26909b2a4ebdebf..6d2c2b445e60db10f496bd247bf6c83c1f9b01ae 100644 (file)
@@ -91,7 +91,7 @@
 (define_constraint "L"
   "A 16-bit unsigned constant, multiple of 4 (-65532..0)"
   (and (match_code "const_int")
-       (match_test "-65532 <= ival && ival <= 0 && (ival & 3) == 0")))
+       (match_test "ival >= -65532 && ival <= 0 && (ival & 3) == 0")))
 
 (define_constraint "S"
   "A 20-bit signed constant (-524288..524287)"
 (define_constraint "b"
   "A constant for a bitfield width (1..16)"
   (and (match_code "const_int")
-       (match_test "1 <= ival && ival <= 16")))
+       (match_test "ival >= 1 && ival <= 16")))
 
 (define_constraint "KA"
   "A 10-bit signed constant (-512..511)"
   (and (match_code "const_int")
-       (match_test "-512 <= ival && ival <= 511")))
+       (match_test "ival >= -512 && ival <= 511")))
index ddc847a8eb861cd91add820d95e47634b6600d60..bc49963ed54c6d5bb304e915e87933111920a58f 100644 (file)
@@ -265,12 +265,12 @@ ft32_load_immediate (rtx dst, int32_t i)
 {
   char pattern[100];
 
-  if ((-524288 <= i) && (i <= 524287))
+  if (i >= -524288 && i <= 524287)
     {
       sprintf (pattern, "ldk.l  %%0,%d", i);
       output_asm_insn (pattern, &dst);
     }
-  else if ((-536870912 <= i) && (i <= 536870911))
+  else if (i >= -536870912 && i <= 536870911)
     {
       ft32_load_immediate (dst, i >> 10);
       sprintf (pattern, "ldl.l  %%0,%%0,%d", i & 1023);
@@ -283,7 +283,7 @@ ft32_load_immediate (rtx dst, int32_t i)
       for (rd = 1; rd < 32; rd++)
         {
           u = ((u >> 31) & 1) | (u << 1);
-          if ((-524288 <= (int32_t) u) && ((int32_t) u <= 524287))
+         if ((int32_t) u >= -524288 && (int32_t) u <= 524287)
             {
               ft32_load_immediate (dst, (int32_t) u);
               sprintf (pattern, "ror.l  %%0,%%0,%d", rd);
@@ -496,7 +496,7 @@ ft32_expand_prologue (void)
        }
     }
 
-  if (65536 <= cfun->machine->size_for_adjusting_sp)
+  if (cfun->machine->size_for_adjusting_sp >= 65536)
     {
       error ("stack frame must be smaller than 64K");
       return;
index c574375df6338144b2c275f3a3c81878d6d6291a..88c21534471c115efe434cf2bb099c0a94c999a2 100644 (file)
@@ -1267,7 +1267,7 @@ h8300_rtx_costs (rtx x, machine_mode mode ATTRIBUTE_UNUSED, int outer_code,
            *total = 0;
            return true;
          }
-       if (-4 <= n && n <= 4)
+       if (n >= -4 && n <= 4)
          {
            switch ((int) n)
              {
@@ -4171,7 +4171,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
              goto end;
            }
        }
-      else if ((8 <= count && count <= 13)
+      else if ((count >= 8 && count <= 13)
               || (TARGET_H8300S && count == 14))
        {
          info->remainder = count - 8;
@@ -4251,7 +4251,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
       gcc_unreachable ();
 
     case SIshift:
-      if (TARGET_H8300 && 8 <= count && count <= 9)
+      if (TARGET_H8300 && count >= 8 && count <= 9)
        {
          info->remainder = count - 8;
 
@@ -4314,9 +4314,9 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
              gcc_unreachable ();
            }
        }
-      else if ((TARGET_H8300 && 16 <= count && count <= 20)
-              || (TARGET_H8300H && 16 <= count && count <= 19)
-              || (TARGET_H8300S && 16 <= count && count <= 21))
+      else if ((TARGET_H8300 && count >= 16 && count <= 20)
+              || (TARGET_H8300H && count >= 16 && count <= 19)
+              || (TARGET_H8300S && count >= 16 && count <= 21))
        {
          info->remainder = count - 16;
 
@@ -4353,7 +4353,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
              goto end;
            }
        }
-      else if (TARGET_H8300 && 24 <= count && count <= 28)
+      else if (TARGET_H8300 && count >= 24 && count <= 28)
        {
          info->remainder = count - 24;
 
@@ -4377,7 +4377,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
            }
        }
       else if ((TARGET_H8300H && count == 24)
-              || (TARGET_H8300S && 24 <= count && count <= 25))
+              || (TARGET_H8300S && count >= 24 && count <= 25))
        {
          info->remainder = count - 24;
 
index 82a79bdb4264117e92f4b983d44f30d95226c3b2..85988cf2de0d7cee9eff370dff25ce60057310da 100644 (file)
@@ -3160,8 +3160,8 @@ ix86_parse_stringop_strategy_string (char *strategy_str, bool is_memset)
       if (next_range_str)
         *next_range_str++ = '\0';
 
-      if (3 != sscanf (curr_range_str, "%20[^:]:%d:%10s",
-                       alg_name, &maxs, align))
+      if (sscanf (curr_range_str, "%20[^:]:%d:%10s", alg_name, &maxs,
+                 align) != 3)
         {
          error ("wrong argument %qs to option %qs", curr_range_str, opt);
           return;
index ee107cbd81f4c67a5c4012ba99cedd2553652799..0759df102d91402ec33ffc60612542efdfb0b319 100644 (file)
@@ -1982,10 +1982,10 @@ iq2000_expand_prologue (void)
        {
          if (next_arg == 0
              && DECL_NAME (cur_arg)
-             && ((0 == strcmp (IDENTIFIER_POINTER (DECL_NAME (cur_arg)),
-                               "__builtin_va_alist"))
-                 || (0 == strcmp (IDENTIFIER_POINTER (DECL_NAME (cur_arg)),
-                                  "va_alist"))))
+             && (strcmp (IDENTIFIER_POINTER (DECL_NAME (cur_arg)),
+                         "__builtin_va_alist") == 0
+                 || strcmp (IDENTIFIER_POINTER (DECL_NAME (cur_arg)),
+                            "va_alist") == 0))
            {
              last_arg_is_vararg_marker = 1;
              break;
index c44e59c4aa65c25288d8edbc157ab0bfc5424ac3..f974b06af494a806c15e26cb9451e4b93c957e61 100644 (file)
@@ -53,7 +53,7 @@ m32c_pragma_memregs (cpp_reader * reader ATTRIBUTE_UNUSED)
          if (type != CPP_EOF)
            warning (0, "junk at end of #pragma GCC memregs [0..16]");
 
-         if (0 <= i && i <= 16)
+         if (i >= 0 && i <= 16)
            {
              if (!ok_to_change_target_memregs)
                {
index f6b711eaf6dba24670375ebe5bbc53f22376c0ae..f1a465a4b44dd6b995d417781d19e27331a42497 100644 (file)
@@ -517,7 +517,7 @@ m32c_conditional_register_usage (void)
 {
   int i;
 
-  if (0 <= target_memregs && target_memregs <= 16)
+  if (target_memregs >= 0 && target_memregs <= 16)
     {
       /* The command line option is bytes, but our "registers" are
         16-bit words.  */
@@ -2308,9 +2308,9 @@ m32c_address_cost (rtx addr, machine_mode mode ATTRIBUTE_UNUSED,
       i = INTVAL (addr);
       if (i == 0)
        return COSTS_N_INSNS(1);
-      if (0 < i && i <= 255)
+      if (i > 0 && i <= 255)
        return COSTS_N_INSNS(2);
-      if (0 < i && i <= 65535)
+      if (i > 0 && i <= 65535)
        return COSTS_N_INSNS(3);
       return COSTS_N_INSNS(4);
     case SYMBOL_REF:
@@ -2323,9 +2323,9 @@ m32c_address_cost (rtx addr, machine_mode mode ATTRIBUTE_UNUSED,
          i = INTVAL (XEXP (addr, 1));
          if (i == 0)
            return COSTS_N_INSNS(1);
-         if (0 < i && i <= 255)
+         if (i > 0 && i <= 255)
            return COSTS_N_INSNS(2);
-         if (0 < i && i <= 65535)
+         if (i > 0 && i <= 65535)
            return COSTS_N_INSNS(3);
        }
       return COSTS_N_INSNS(4);
index 7423a024e395132fb34879d239f508e976c78ff4..de7e899ddc706d483266c6e05c9f7946953c9e7f 100644 (file)
 (define_predicate "shiftcount_operand"
   (ior (match_operand 0 "mra_operand" "")
        (and (match_operand 2 "const_int_operand" "")
-           (match_test "-8 <= INTVAL (op) && INTVAL (op) && INTVAL (op) <= 8"))))
+           (match_test "INTVAL (op) >= -8 && INTVAL (op) && INTVAL (op) <= 8"))))
 (define_predicate "longshiftcount_operand"
   (ior (match_operand 0 "mra_operand" "")
        (and (match_operand 2 "const_int_operand" "")
-           (match_test "-32 <= INTVAL (op) && INTVAL (op) && INTVAL (op) <= 32"))))
+           (match_test "INTVAL (op) >= -32 && INTVAL (op) && INTVAL (op) <= 32"))))
 
 ; TRUE for r0..r3, a0..a1, or sp.
 (define_predicate "mra_or_sp_operand"
index 9e428304a5d4684ec1752dda27745e834bda72bc..a0fab4c0bb41982e0cde3fe7969372f0299d5e32 100644 (file)
@@ -3523,8 +3523,7 @@ output_reg_adjust (rtx reg, int n)
 {
   const char *s;
 
-  gcc_assert (GET_MODE (reg) == SImode
-             && -12 <= n && n != 0 && n <= 12);
+  gcc_assert (GET_MODE (reg) == SImode && n >= -12 && n != 0 && n <= 12);
 
   switch (n)
     {
@@ -3566,8 +3565,7 @@ emit_reg_adjust (rtx reg1, int n)
 {
   rtx reg2;
 
-  gcc_assert (GET_MODE (reg1) == SImode
-             && -12 <= n && n != 0 && n <= 12);
+  gcc_assert (GET_MODE (reg1) == SImode && n >= -12 && n != 0 && n <= 12);
 
   reg1 = copy_rtx (reg1);
   reg2 = copy_rtx (reg1);
index f6084039eea405774a1185a7125db5c70e7aa2dd..1db8dec32bf55b7c27a286f3b54bd1dde20dcb99 100644 (file)
@@ -1330,7 +1330,7 @@ nios2_handle_custom_fpu_insn_option (int fpu_insn_index)
 {
   int param = N2FPU_N (fpu_insn_index);
 
-  if (0 <= param && param <= 255)
+  if (param >= 0 && param <= 255)
     nios2_register_custom_code (param, CCS_FPU, fpu_insn_index);
 
   /* Valid values are 0-255, but also allow -1 so that the
@@ -5131,7 +5131,7 @@ static bool
 can_use_cdx_ldstw (int regno, int basereg, int offset)
 {
   if (CDX_REG_P (regno) && CDX_REG_P (basereg)
-      && (offset & 0x3) == 0 && 0 <= offset && offset < 0x40)
+      && (offset & 0x3) == 0 && offset >= 0 && offset < 0x40)
     return true;
   else if (basereg == SP_REGNO
           && offset >= 0 && offset < 0x80 && (offset & 0x3) == 0)
index 9fdff024cd859495160b3aa31cc80c08dd3f9258..e18e88e9c13c4bed3bd75fdd191bb4edf2672a22 100644 (file)
@@ -221,7 +221,7 @@ enum reg_class
   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
 #define CDX_REG_P(REGNO)                                               \
-  ((REGNO) == 16 || (REGNO) == 17 || (2 <= (REGNO) && (REGNO) <= 7))
+  ((REGNO) == 16 || (REGNO) == 17 || ((REGNO) >= 2 && (REGNO) <= 7))
 
 /* Tests for various kinds of constants used in the Nios II port.  */
 
index 227d48a9bcd05165dd3e744c67d442a11582cc9a..3ac8fd605c32eeee2cf7698738dbbb94142242b2 100644 (file)
 (define_constraint "U06"
    "unsigned 6 bit value (0..63)"
    (and (match_code "const_int")
-       (match_test "0 <= ival && ival < 64")))
+       (match_test "ival >= 0 && ival < 64")))
 
 (define_constraint "U08"
    "Unsigned 8 bit value"
    (and (match_code "const_int")
-       (match_test "0 <= ival && ival < 256")))
+       (match_test "ival >= 0 && ival < 256")))
 
 (define_constraint "U16"
    "Unsigned 16 bit value"
    (and (match_code "const_int")
-       (match_test "0 <= ival && ival < 65536")))
+       (match_test "ival >= 0 && ival < 65536")))
 
 (define_constraint "CN6"
    "negative 6 bit value (-63..-1)"
    (and (match_code "const_int")
-       (match_test "-63 <= ival && ival < 0")))
+       (match_test "ival >= -63 && ival < 0")))
 
 (define_constraint "S08"
    "signed 8 bit value [old]"
    (and (match_code "const_int")
-       (match_test "-128 <= ival && ival < 128")))
+       (match_test "ival >= -128 && ival < 128")))
 
 (define_constraint "S16"
    "signed 16 bit value [old]"
    (and (match_code "const_int")
-       (match_test "-32768 <= ival && ival < 32768")))
+       (match_test "ival >= -32768 && ival < 32768")))
 
 (define_constraint "I"
    "Match a CONST_INT of 0 [old]"
index 8bc40eb67d271712549fd6cfef061d60a6a8c5f3..f739c6fe9b94db8045358423d1ebbf59a3c7de99 100644 (file)
@@ -2029,7 +2029,7 @@ adjacent_operands_p (rtx lo, rtx hi, machine_mode mode)
   if (REG_P (lo))
     return mode == SImode && REGNO (lo) + 1 == REGNO (hi);
   if (CONST_INT_P (lo))
-    return INTVAL (hi) == 0 && 0 <= INTVAL (lo) && INTVAL (lo) < 64;
+    return INTVAL (hi) == 0 && UINTVAL (lo) < 64;
   if (CONST_INT_P (lo))
     return mode != SImode;
 
index 133b9fd5df314685facc3ce3586b49cf98da8ca5..15e0bebc08554ae72541724aa8418f9cddcf2645 100644 (file)
 (define_constraint "J"
   "Integer constant in the range 0 .. 65535 (16-bit immediate)"
   (and (match_code "const_int")
-       (match_test "0 <= ival && ival <= 65535")))
+       (match_test "ival >= 0 && ival <= 65535")))
 
 (define_constraint "K"
   "Integer constant in the range 1 .. 31 (5-bit immediate)"
   (and (match_code "const_int")
-       (match_test "1 <= ival && ival <= 31")))
+       (match_test "ival >= 1 && ival <= 31")))
 
 (define_constraint "L"
   "Integer constant in the range -65535 .. -1 (16-bit negative immediate)"
   (and (match_code "const_int")
-       (match_test "-65535 <= ival && ival <= -1")))
+       (match_test "ival >= -65535 && ival <= -1")))
 
 (define_constraint "M"
   "Integer constant -1"
index a24e0321a7dce0afbeadc2a46341b423e6493bff..e1dd29cb8fba24f544056a0a05d255a048ebfd6e 100644 (file)
@@ -25,7 +25,7 @@
 ;; Return true if OP is a constant in the range 1 .. 31.
 (define_predicate "const_shift_operand"
   (and (match_code "const_int")
-       (match_test "1 <= INTVAL (op) && INTVAL (op) <= 31")))
+       (match_test "INTVAL (op) >= 1 && INTVAL (op) <= 31")))
 
 ;; Return true if OP is either a register or the constant 0.
 (define_predicate "reg_or_0_operand"
index 991783da73947d3950946ef16a4041627527cc3a..58c4e572623bd1244aee5ee3790d164483f49c44 100644 (file)
@@ -1922,7 +1922,7 @@ visium_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
       int offset_base = offset & ~mask;
 
       /* Check that all of the words can be accessed.  */
-      if (4 < size && 0x80 < size + offset - offset_base)
+      if (size > 4 && 0x80 < size + offset - offset_base)
        offset_base = offset & ~0x3f;
       if (offset_base != 0 && offset_base != offset && (offset & mask1) == 0)
        {
@@ -1968,7 +1968,7 @@ visium_legitimize_reload_address (rtx x, machine_mode mode, int opnum,
       int offset_base = offset & ~mask;
 
       /* Check that all of the words can be accessed.  */
-      if (4 < size && 0x80 < size + offset - offset_base)
+      if (size > 4 && 0x80 < size + offset - offset_base)
        offset_base = offset & ~0x3f;
 
       if (offset_base && (offset & mask1) == 0)
index a47b0aede2010800d271bf0ed92930475e148a97..8a66949be12e545f412b3c93a40f0bafbaf8e959 100644 (file)
@@ -1,3 +1,12 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2017-12-19  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * cp-tree.h: Fix typo in comment.
index 73529a94a52377c74c1c06229aeff738f2aa4883..d63a65ee7e2de7a88bda31bcf0c8d5fc7927db16 100644 (file)
@@ -3276,12 +3276,14 @@ check_bitfield_decl (tree field)
                   && tree_int_cst_lt (TYPE_SIZE (type), w)))
        warning_at (DECL_SOURCE_LOCATION (field), 0,
                    "width of %qD exceeds its type", field);
-      else if (TREE_CODE (type) == ENUMERAL_TYPE
-              && (0 > (compare_tree_int
-                       (w, TYPE_PRECISION (ENUM_UNDERLYING_TYPE (type))))))
-       warning_at (DECL_SOURCE_LOCATION (field), 0,
-                   "%qD is too small to hold all values of %q#T",
-                   field, type);
+      else if (TREE_CODE (type) == ENUMERAL_TYPE)
+       {
+         int prec = TYPE_PRECISION (ENUM_UNDERLYING_TYPE (type));
+         if (compare_tree_int (w, prec) < 0)
+           warning_at (DECL_SOURCE_LOCATION (field), 0,
+                       "%qD is too small to hold all values of %q#T",
+                       field, type);
+       }
     }
 
   if (w != error_mark_node)
index ca9e0c7b2058b2fda2c075526c23038d65bc3c2d..453a2bd91970855de8ac1a947995be80ad99d750 100644 (file)
@@ -1858,8 +1858,8 @@ next_arg:;
                   t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2), i++)
                if (TREE_PURPOSE (t1) && TREE_PURPOSE (t2))
                  {
-                   if (1 == simple_cst_equal (TREE_PURPOSE (t1),
-                                              TREE_PURPOSE (t2)))
+                   if (simple_cst_equal (TREE_PURPOSE (t1),
+                                         TREE_PURPOSE (t2)) == 1)
                      {
                        if (permerror (input_location,
                                       "default argument given for parameter "
index 978ff77ae751ab700ee3e9935d7779c542c40762..f898c4e7159f6b0644a1ccd93f3717db5048cb66 100644 (file)
@@ -5485,7 +5485,7 @@ get_std_name_hint (const char *name)
   const size_t num_hints = sizeof (hints) / sizeof (hints[0]);
   for (size_t i = 0; i < num_hints; i++)
     {
-      if (0 == strcmp (name, hints[i].name))
+      if (strcmp (name, hints[i].name) == 0)
        return hints[i].header;
     }
   return NULL;
index 4b42f03c27f9fcf2d2ef186842e95691d165068b..71f45de1dd95ba169a29c9b2cadb4920c3166a04 100644 (file)
@@ -7838,7 +7838,7 @@ convert_template_argument (tree parm,
          if (innertype
              && TREE_CODE (innertype) == REFERENCE_TYPE
              && TREE_CODE (TREE_TYPE (innertype)) == FUNCTION_TYPE
-              && 0 < TREE_OPERAND_LENGTH (inner)
+             && TREE_OPERAND_LENGTH (inner) > 0
               && reject_gcc_builtin (TREE_OPERAND (inner, 0)))
               return error_mark_node;
         }
index 390aa1580bd1f01b95943d7cf0693c560d16b9fd..d6e235eb2b54cedc0d06ce8f334c162d05cb44cc 100644 (file)
@@ -214,7 +214,7 @@ commonparms (tree p1, tree p2)
        }
       else
        {
-         if (1 != simple_cst_equal (TREE_PURPOSE (p1), TREE_PURPOSE (p2)))
+         if (simple_cst_equal (TREE_PURPOSE (p1), TREE_PURPOSE (p2)) != 1)
            any_change = 1;
          TREE_PURPOSE (n) = TREE_PURPOSE (p2);
        }
index 38cc63af9259873040d9690c0d11d1c8c648405f..19827138ced9cad2ba4be4ba0785f98c448cb1a0 100644 (file)
@@ -3043,7 +3043,7 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
          int offs;
          letter = 'G';
          code = N_GSYM;
-         if (NULL != dbxout_common_check (decl, &offs))
+         if (dbxout_common_check (decl, &offs) != NULL)
            {
              letter = 'V';
              addr = 0;
@@ -3097,7 +3097,7 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
            {
              int offs;
              code = N_LCSYM;
-             if (NULL != dbxout_common_check (decl, &offs))
+             if (dbxout_common_check (decl, &offs) != NULL)
                {
                  addr = 0;
                  number = offs;
@@ -3196,7 +3196,7 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
       int offs;
       code = N_LCSYM;
       letter = 'V';
-      if (NULL == dbxout_common_check (decl, &offs))
+      if (dbxout_common_check (decl, &offs) == NULL)
         addr = XEXP (XEXP (home, 0), 0);
       else
         {
index 387c24555fc756f044abea40389fad42f8397d0f..d3f38a93433a54a97ef6d9da44c1b10d2bde41f7 100644 (file)
@@ -1866,7 +1866,7 @@ layout::show_ruler (int max_column) const
     {
       pp_space (m_pp);
       for (int column = 1 + m_x_offset; column <= max_column; column++)
-       if (0 == column % 10)
+       if (column % 10 == 0)
          pp_character (m_pp, '0' + (column / 100) % 10);
        else
          pp_space (m_pp);
@@ -1876,7 +1876,7 @@ layout::show_ruler (int max_column) const
   /* Tens.  */
   pp_space (m_pp);
   for (int column = 1 + m_x_offset; column <= max_column; column++)
-    if (0 == column % 10)
+    if (column % 10 == 0)
       pp_character (m_pp, '0' + (column / 10) % 10);
     else
       pp_space (m_pp);
index db8b278b982b6208196c8673b5571d91ee3d1658..256d02b14dded4415f6be024264f3d9a9273fa3a 100644 (file)
@@ -1002,8 +1002,8 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
   do_pending_stack_adjust ();
 
   code = unsignedp ? unsigned_condition (code) : code;
-  if (0 != (tem = simplify_relational_operation (code, mode, VOIDmode,
-                                                op0, op1)))
+  if ((tem = simplify_relational_operation (code, mode, VOIDmode,
+                                           op0, op1)) != 0)
     {
       if (CONSTANT_P (tem))
        {
index 658500b6103b53494c97394c452c15838f88325a..4a59d6010442a838a09afe95bd627e3056dbcbe2 100644 (file)
@@ -251,7 +251,7 @@ gcc::dump_manager::
 get_dump_file_info_by_switch (const char *swtch) const
 {
   for (unsigned i = 0; i < m_extra_dump_files_in_use; i++)
-    if (0 == strcmp (m_extra_dump_files[i].swtch, swtch))
+    if (strcmp (m_extra_dump_files[i].swtch, swtch) == 0)
       return &m_extra_dump_files[i];
 
   /* Not found.  */
index 5ab1fb79085b42de3b82102a9fbf24855c899ea3..9ba2a930b6794abc585523debcafb77f7138ee64 100644 (file)
@@ -4047,7 +4047,7 @@ add_insn (rtx_insn *insn)
 {
   rtx_insn *prev = get_last_insn ();
   link_insn_into_chain (insn, prev, NULL);
-  if (NULL == get_insns ())
+  if (get_insns () == NULL)
     set_first_insn (insn);
   set_last_insn (insn);
 }
index c774636d9ad5a85499c686c432a2fed736c64b79..66511eb258186bf5d2c2d77d90d9f428c359d0db 100644 (file)
@@ -671,7 +671,7 @@ et_nca (struct et_node *n1, struct et_node *n2)
       return NULL;
     }
 
-  if (0 < o2->depth)
+  if (o2->depth > 0)
     {
       om = o1;
       mn = o1->depth;
@@ -743,7 +743,7 @@ et_below (struct et_node *down, struct et_node *up)
       return false;
     }
 
-  if (0 >= d->depth)
+  if (d->depth <= 0)
     return false;
 
   return !d->next || d->next->min + d->depth >= 0;
index 696f06673eb71f3033d00fac2b529bbfee45cc54..986002ed103f2163c171cd69026c6e96a848a7d8 100644 (file)
@@ -210,8 +210,8 @@ eliminate_constant_term (rtx x, rtx *constptr)
 
   /* First handle constants appearing at this level explicitly.  */
   if (CONST_INT_P (XEXP (x, 1))
-      && 0 != (tem = simplify_binary_operation (PLUS, GET_MODE (x), *constptr,
-                                               XEXP (x, 1)))
+      && (tem = simplify_binary_operation (PLUS, GET_MODE (x), *constptr,
+                                          XEXP (x, 1))) != 0
       && CONST_INT_P (tem))
     {
       *constptr = tem;
@@ -222,8 +222,8 @@ eliminate_constant_term (rtx x, rtx *constptr)
   x0 = eliminate_constant_term (XEXP (x, 0), &tem);
   x1 = eliminate_constant_term (XEXP (x, 1), &tem);
   if ((x1 != XEXP (x, 1) || x0 != XEXP (x, 0))
-      && 0 != (tem = simplify_binary_operation (PLUS, GET_MODE (x),
-                                               *constptr, tem))
+      && (tem = simplify_binary_operation (PLUS, GET_MODE (x),
+                                          *constptr, tem)) != 0
       && CONST_INT_P (tem))
     {
       *constptr = tem;
index 0be02757cf8c37740481500de0afa19991fa37b1..13dda74a7dbca25bd8ab9ae117f00ed43e8c6cc8 100644 (file)
@@ -6123,8 +6123,8 @@ store_constructor_field (rtx target, unsigned HOST_WIDE_INT bitsize,
        target
          = adjust_address (target,
                            GET_MODE (target) == BLKmode
-                           || 0 != (bitpos
-                                    % GET_MODE_ALIGNMENT (GET_MODE (target)))
+                           || (bitpos
+                               % GET_MODE_ALIGNMENT (GET_MODE (target))) != 0
                            ? BLKmode : VOIDmode, bitpos / BITS_PER_UNIT);
 
 
@@ -10704,8 +10704,8 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
            || (bitsize >= 0
                && TYPE_SIZE (TREE_TYPE (exp))
                && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST
-               && 0 != compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)),
-                                         bitsize)))
+               && compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)),
+                                    bitsize) != 0))
          {
            machine_mode ext_mode = mode;
 
index d9f2f93b3e25478218b32f19cec794420066afca..e8954914e165f7efb003091054fe160f7297667f 100644 (file)
@@ -4513,11 +4513,9 @@ leaf_renumber_regs_insn (rtx in_rtx)
        break;
 
       case 'E':
-       if (NULL != XVEC (in_rtx, i))
-         {
-           for (j = 0; j < XVECLEN (in_rtx, i); j++)
-             leaf_renumber_regs_insn (XVECEXP (in_rtx, i, j));
-         }
+       if (XVEC (in_rtx, i) != NULL)
+         for (j = 0; j < XVECLEN (in_rtx, i); j++)
+           leaf_renumber_regs_insn (XVECEXP (in_rtx, i, j));
        break;
 
       case 'S':
index 2a08010d1455041e9c455efa16520b0c1fbb8f1c..89a9f4007290b341a6d08573a02b74070e6d4ff0 100644 (file)
@@ -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);
        }
index 5c68938b7131888523dc19d6bd5c77e13a81ef75..a601cfaf0cfed4bd1c891b746259887e9e75e4a8 100644 (file)
@@ -1,3 +1,10 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2017-12-17  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * decl.c (gfc_match_implicit_none): Use GFC_STD_F2018 instead of
index 1af2885c9ef4653bd9361fabfebb7b7f9ed1adeb..29161d12fdfbd998034ed77eaaf6b0756434ee2b 100644 (file)
@@ -1431,17 +1431,17 @@ check_section_vs_section (gfc_array_ref *l_ar, gfc_array_ref *r_ar, int n)
   r_stride = r_ar->stride[n];
 
   /* If l_start is NULL take it from array specifier.  */
-  if (NULL == l_start && IS_ARRAY_EXPLICIT (l_ar->as))
+  if (l_start == NULL && IS_ARRAY_EXPLICIT (l_ar->as))
     l_start = l_ar->as->lower[n];
   /* If l_end is NULL take it from array specifier.  */
-  if (NULL == l_end && IS_ARRAY_EXPLICIT (l_ar->as))
+  if (l_end == NULL && IS_ARRAY_EXPLICIT (l_ar->as))
     l_end = l_ar->as->upper[n];
 
   /* If r_start is NULL take it from array specifier.  */
-  if (NULL == r_start && IS_ARRAY_EXPLICIT (r_ar->as))
+  if (r_start == NULL && IS_ARRAY_EXPLICIT (r_ar->as))
     r_start = r_ar->as->lower[n];
   /* If r_end is NULL take it from array specifier.  */
-  if (NULL == r_end && IS_ARRAY_EXPLICIT (r_ar->as))
+  if (r_end == NULL && IS_ARRAY_EXPLICIT (r_ar->as))
     r_end = r_ar->as->upper[n];
 
   /* Determine whether the l_stride is positive or negative.  */
index 49decfac52a0324bba396eaf2739bb716d9d9170..4a0792d8cfdbdd24d8527602b09c622e90d9b161 100644 (file)
@@ -2057,7 +2057,7 @@ preprocessor_line (gfc_char_t *c)
       c++;
       i = wide_atoi (c);
 
-      if (1 <= i && i <= 4)
+      if (i >= 1 && i <= 4)
        flag[i] = true;
     }
 
index 155702a0a10255842bb121d32f14c1c3420fb3a6..1b6e2159ae1c759b2b16f28b619801a5d40b1933 100644 (file)
@@ -7003,7 +7003,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
 
   /* Special case: TRANSPOSE which needs no temporary.  */
   while (expr->expr_type == EXPR_FUNCTION && expr->value.function.isym
-      && NULL != (arg = gfc_get_noncopying_intrinsic_argument (expr)))
+        && (arg = gfc_get_noncopying_intrinsic_argument (expr)) != NULL)
     {
       /* This is a call to transpose which has already been handled by the
         scalarizer, so that we just need to get its argument's descriptor.  */
index 38b957728577f070b7bbea5d52a766f940f4fc85..092b2852763ebbdacc4e4828ddd0de87028a4c23 100644 (file)
@@ -1136,7 +1136,7 @@ insert_expr_in_table (rtx x, machine_mode mode, rtx_insn *insn,
   cur_expr = table->table[hash];
   found = 0;
 
-  while (cur_expr && 0 == (found = expr_equiv_p (cur_expr->expr, x)))
+  while (cur_expr && (found = expr_equiv_p (cur_expr->expr, x)) == 0)
     {
       /* If the expression isn't found, save a pointer to the end of
         the list.  */
index f6ad3987faa9b77ef0d6d6a0bb479eb00b91284c..be5a51d058bb008872e172bb38e9e3cbb8747eca 100644 (file)
@@ -948,9 +948,9 @@ type (options_p *optsp, bool nested)
                advance ();
                const char *basename = require (ID);
                /* This may be either an access specifier, or the base name.  */
-               if (0 == strcmp (basename, "public")
-                   || 0 == strcmp (basename, "protected")
-                   || 0 == strcmp (basename, "private"))
+               if (strcmp (basename, "public") == 0
+                   || strcmp (basename, "protected") == 0
+                   || strcmp (basename, "private") == 0)
                  basename = require (ID);
                base_class = find_structure (basename, TYPE_STRUCT);
                if (!base_class)
index aeca2628ec1fdf964a819ac78a255b28c49cfe5b..eca66161c898d59ee9db4c6020a965aa863a81d8 100644 (file)
@@ -671,7 +671,7 @@ type_for_name (const char *s)
          extern GTY(()) gcc::some_type *some_ptr;
      where the autogenerated functions will refer to simply "some_type",
      where they can be resolved into their namespace.  */
-  if (0 == strncmp (s, "gcc::", 5))
+  if (strncmp (s, "gcc::", 5) == 0)
     s += 5;
 
   for (p = typedefs; p != NULL; p = p->next)
index fb380c586ffba4559e1c9acd491ace521fc28e8b..7e6859c1358c818fb75733c4b17b1c9108a77de5 100644 (file)
@@ -323,7 +323,7 @@ emit_init_macros (const char *docname)
                }
              continue;
            }
-         if (0 == print_nest)
+         if (print_nest == 0)
            {
              /* Output default definitions of target hooks.  */
              printf ("#ifndef %s\n#define %s %s\n#endif\n",
index 75935bef5e8e0bd76355b5fa4bf8712c5c48bfa3..eddc20e2ac4e1006cd910d8b9e3c5fdefd720745 100644 (file)
@@ -2854,7 +2854,7 @@ format_directive (const sprintf_dom_walker::call_info &info,
 
   if (!warned
       /* Only warn at level 2.  */
-      && 1 < warn_level
+      && warn_level > 1
       && (!minunder4k
          || (!maxunder4k && fmtres.range.max < HOST_WIDE_INT_MAX)))
     {
@@ -2902,7 +2902,7 @@ format_directive (const sprintf_dom_walker::call_info &info,
       /* Warn for the likely output size at level 1.  */
       && (likelyximax
          /* But only warn for the maximum at level 2.  */
-         || (1 < warn_level
+         || (warn_level > 1
              && maxximax
              && fmtres.range.max < HOST_WIDE_INT_MAX)))
     {
index a01c504fe57d4ff2adf9f6160334fcbfaee1fe41..6c7651a409611ef17ddacbb8047950229d606b6e 100644 (file)
@@ -1117,7 +1117,7 @@ dump_location_info (FILE *stream)
          expanded_location exploc
            = linemap_expand_location (line_table, map, loc);
 
-         if (0 == exploc.column)
+         if (exploc.column == 0)
            {
              /* Beginning of a new source line: draw the line.  */
 
index e30e39eb3d4441c0faca2261ab60484ce60e89e7..63c00d0aeed01027b1140b18df18c3acf3d0348d 100644 (file)
@@ -2756,8 +2756,8 @@ setup_min_max_allocno_live_range_point (void)
 #ifdef ENABLE_IRA_CHECKING
   FOR_EACH_OBJECT (obj, oi)
     {
-      if ((0 <= OBJECT_MIN (obj) && OBJECT_MIN (obj) <= ira_max_point)
-         && (0 <= OBJECT_MAX (obj) && OBJECT_MAX (obj) <= ira_max_point))
+      if ((OBJECT_MIN (obj) >= 0 && OBJECT_MIN (obj) <= ira_max_point)
+         && (OBJECT_MAX (obj) >= 0 && OBJECT_MAX (obj) <= ira_max_point))
        continue;
       gcc_unreachable ();
     }
index 7be5c47f01d6f9aaf0c8e339b36e9459497fa24c..eb2f793279e0ae8f0446691afd88647afc80e3f9 100644 (file)
@@ -1,3 +1,17 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2017-11-30  Jakub Jelinek  <jakub@redhat.com>
 
        * jit-recording.c
index 35c4db048755c08c1c9ae326515261ddd27632ce..ee37495e908f5e8acab0c2082da2e314a31253b4 100644 (file)
@@ -76,24 +76,20 @@ matches_builtin (const char *in_name,
   if (debug)
     fprintf (stderr, "seen builtin: %s\n", bd.name);
 
-  if (0 == strcmp (bd.name, in_name))
-    {
-      return true;
-    }
+  if (strcmp (bd.name, in_name) == 0)
+    return true;
 
   if (bd.both_p)
     {
       /* Then the macros in builtins.def gave a "__builtin_"
         prefix to bd.name, but we should also recognize the form
         without the prefix.  */
-      gcc_assert (0 == strncmp (bd.name, prefix, prefix_len));
+      gcc_assert (strncmp (bd.name, prefix, prefix_len) == 0);
       if (debug)
        fprintf (stderr, "testing without prefix as: %s\n",
                 bd.name + prefix_len);
-      if (0 == strcmp (bd.name + prefix_len, in_name))
-       {
-         return true;
-       }
+      if (strcmp (bd.name + prefix_len, in_name) == 0)
+       return true;
     }
 
   return false;
index 9c39f62dd49d9b125ad590427af43c12d735f8f6..779b756abcc9e2e61966514a42abfb865868ef89 100644 (file)
@@ -79,7 +79,7 @@ logger::decref (const char *reason)
   if (m_log_refcount_changes)
     log ("%s: reason: %s refcount now %i",
         __PRETTY_FUNCTION__, reason, m_refcount);
-  if (0 == m_refcount)
+  if (m_refcount == 0)
     delete this;
 }
 
index fe9fb2d8bc29cb2cb5adde978417401c029d41b9..43b0ec9c7d5ee3a7730e56c86c94cdb5bb22719d 100644 (file)
@@ -211,10 +211,9 @@ playback::context::
 get_type (enum gcc_jit_types type_)
 {
   tree type_node = get_tree_node_for_type (type_);
-  if (NULL == type_node)
+  if (type_node == NULL)
     {
-      add_error (NULL,
-                "unrecognized (enum gcc_jit_types) value: %i", type_);
+      add_error (NULL, "unrecognized (enum gcc_jit_types) value: %i", type_);
       return NULL;
     }
 
@@ -2049,7 +2048,7 @@ playback::compile_to_file::copy_file (const char *src_path,
   /* Use stat on the filedescriptor to get the mode,
      so that we can copy it over (in particular, the
      "executable" bits).  */
-  if (-1 == fstat (fileno (f_in), &stat_buf))
+  if (fstat (fileno (f_in), &stat_buf) == -1)
     {
       add_error (NULL,
                 "unable to fstat %s: %s",
@@ -2113,7 +2112,7 @@ playback::compile_to_file::copy_file (const char *src_path,
 
   /* Set the permissions of the copy to those of the original file,
      in particular the "executable" bits.  */
-  if (-1 == fchmod (fileno (f_out), stat_buf.st_mode))
+  if (fchmod (fileno (f_out), stat_buf.st_mode) == -1)
     add_error (NULL,
               "error setting mode of %s: %s",
               dst_path,
@@ -2139,7 +2138,7 @@ playback::context::acquire_mutex ()
   /* Acquire the big GCC mutex. */
   JIT_LOG_SCOPE (get_logger ());
   pthread_mutex_lock (&jit_mutex);
-  gcc_assert (NULL == active_playback_ctxt);
+  gcc_assert (active_playback_ctxt == NULL);
   active_playback_ctxt = this;
 }
 
index fb492c09142ffbfd511a8a7b57ee6d18b28eb204..f2cfcfd50febdd3c17a24f581acdf007c8f84ea0 100644 (file)
@@ -2987,7 +2987,7 @@ recording::compound_type::set_fields (location *loc,
                                      field **field_array)
 {
   m_loc = loc;
-  gcc_assert (NULL == m_fields);
+  gcc_assert (m_fields == NULL);
 
   m_fields = new fields (this, num_fields, field_array);
   m_ctxt->record (m_fields);
@@ -3182,7 +3182,7 @@ void
 recording::fields::write_reproducer (reproducer &r)
 {
   if (m_struct_or_union)
-    if (NULL == m_struct_or_union->dyn_cast_struct ())
+    if (m_struct_or_union->dyn_cast_struct () == NULL)
       /* We have a union; the fields have already been written by
         union::write_reproducer.  */
       return;
@@ -3370,7 +3370,7 @@ void
 recording::rvalue::set_scope (function *scope)
 {
   gcc_assert (scope);
-  gcc_assert (NULL == m_scope);
+  gcc_assert (m_scope == NULL);
   m_scope = scope;
 }
 
@@ -3750,7 +3750,7 @@ recording::function::validate ()
   /* Complain about empty functions with non-void return type.  */
   if (m_kind != GCC_JIT_FUNCTION_IMPORTED
       && m_return_type != m_ctxt->get_type (GCC_JIT_TYPE_VOID))
-    if (0 == m_blocks.length ())
+    if (m_blocks.length () == 0)
       m_ctxt->add_error (m_loc,
                         "function %s returns non-void (type: %s)"
                         " but has no blocks",
@@ -3771,7 +3771,7 @@ recording::function::validate ()
   /* Check that all blocks are reachable.  */
   if (!m_ctxt->get_inner_bool_option
         (INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS)
-      && m_blocks.length () > 0 && 0 == num_invalid_blocks)
+      && m_blocks.length () > 0 && num_invalid_blocks == 0)
     {
       /* Iteratively walk the graph of blocks, marking their "m_is_reachable"
         flag, starting at the initial block.  */
index 8bad4f6481a0bf6c250899e13c700722c0548009..fa8ef35b5200e75a0e13f37609c92e8679eee953 100644 (file)
@@ -592,7 +592,7 @@ gcc_jit_context_new_struct_type (gcc_jit_context *ctxt,
     {
       RETURN_NULL_IF_FAIL (fields[i], ctxt, loc, "NULL field ptr");
       RETURN_NULL_IF_FAIL_PRINTF2 (
-       NULL == fields[i]->get_container (),
+       fields[i]->get_container () == NULL,
        ctxt, loc,
        "%s is already a field of %s",
        fields[i]->get_debug_string (),
@@ -657,7 +657,7 @@ gcc_jit_struct_set_fields (gcc_jit_struct *struct_type,
   JIT_LOG_FUNC (ctxt->get_logger ());
   /* LOC can be NULL.  */
   RETURN_IF_FAIL_PRINTF1 (
-    NULL == struct_type->get_fields (), ctxt, loc,
+    struct_type->get_fields () == NULL, ctxt, loc,
     "%s already has had fields set",
     struct_type->get_debug_string ());
   if (num_fields)
@@ -671,7 +671,7 @@ gcc_jit_struct_set_fields (gcc_jit_struct *struct_type,
        struct_type->get_debug_string (),
        i);
       RETURN_IF_FAIL_PRINTF2 (
-       NULL == fields[i]->get_container (),
+       fields[i]->get_container () == NULL,
        ctxt, loc,
        "%s is already a field of %s",
        fields[i]->get_debug_string (),
@@ -706,7 +706,7 @@ gcc_jit_context_new_union_type (gcc_jit_context *ctxt,
     {
       RETURN_NULL_IF_FAIL (fields[i], ctxt, loc, "NULL field ptr");
       RETURN_NULL_IF_FAIL_PRINTF2 (
-       NULL == fields[i]->get_container (),
+       fields[i]->get_container () == NULL,
        ctxt, loc,
        "%s is already a field of %s",
        fields[i]->get_debug_string (),
@@ -880,7 +880,7 @@ gcc_jit_context_new_function (gcc_jit_context *ctxt,
        ctxt, loc,
        "NULL parameter %i creating function %s", i, name);
       RETURN_NULL_IF_FAIL_PRINTF5 (
-       (NULL == params[i]->get_scope ()),
+       params[i]->get_scope () == NULL,
        ctxt, loc,
        "parameter %i \"%s\""
        " (type: %s)"
@@ -2925,7 +2925,7 @@ gcc_jit_timer_pop (gcc_jit_timer *timer,
         item_name);
 
       RETURN_IF_FAIL_PRINTF2
-       (0 == strcmp (item_name, top_item_name), NULL, NULL,
+       (strcmp (item_name, top_item_name) == 0, NULL, NULL,
         "mismatching item_name:"
         " top of timing stack: \"%s\","
         " attempting to pop: \"%s\"",
index 65568e052fcd7eeae32307109e4ba9c4bfb6ebe0..ad8b0187e3365b6c5f080dc6ff6a52c40041694c 100644 (file)
@@ -1584,7 +1584,7 @@ pass_manager::pass_manager (context *ctxt)
 
 #define NEXT_PASS(PASS, NUM) \
   do { \
-    gcc_assert (NULL == PASS ## _ ## NUM); \
+    gcc_assert (PASS ## _ ## NUM == NULL); \
     if ((NUM) == 1)                              \
       PASS ## _1 = make_##PASS (m_ctxt);          \
     else                                         \
index 8472e519ecbd79766f4e4f2ce2701f5b3d625c9a..68788d7ddf4521e19cd0b83567c8ce7e8ec67ce3 100644 (file)
@@ -1288,7 +1288,7 @@ maybe_ne (const Ca &a, const poly_int_pod<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
-      if (0 != b.coeffs[i])
+      if (b.coeffs[i] != 0)
        return true;
   return a != b.coeffs[0];
 }
@@ -1337,7 +1337,7 @@ maybe_le (const Ca &a, const poly_int_pod<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
-      if (0 < b.coeffs[i])
+      if (b.coeffs[i] > 0)
        return true;
   return a <= b.coeffs[0];
 }
@@ -1379,7 +1379,7 @@ maybe_lt (const Ca &a, const poly_int_pod<N, Cb> &b)
 {
   if (N >= 2)
     for (unsigned int i = 1; i < N; i++)
-      if (0 < b.coeffs[i])
+      if (b.coeffs[i] > 0)
        return true;
   return a < b.coeffs[0];
 }
index 0af739da0be649a78b14549b3a47fe2c2b3aa249..bff9dc578d861570f6b1048bb2b5aab584de1f82 100644 (file)
@@ -346,7 +346,7 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx)
       m_sawclose = 0;
     }
   fputs (" [", m_outfile);
-  if (NULL != XVEC (in_rtx, idx))
+  if (XVEC (in_rtx, idx) != NULL)
     {
       m_indent += 2;
       if (XVECLEN (in_rtx, idx))
index ec25051e702fe49ee4a9200c5ee0000af4450c01..8ddf0ecaabc4befc49bcb9a71b43c6870bc8df7e 100644 (file)
@@ -321,7 +321,7 @@ static int
 parse_note_insn_name (const char *string)
 {
   for (int i = 0; i < NOTE_INSN_MAX; i++)
-    if (0 == strcmp (string, GET_NOTE_INSN_NAME (i)))
+    if (strcmp (string, GET_NOTE_INSN_NAME (i)) == 0)
       return i;
   fatal_with_file_and_line ("unrecognized NOTE_INSN name: `%s'", string);
 }
@@ -1079,7 +1079,7 @@ function_reader::read_rtx_operand_r (rtx x)
         "orig:%i", ORIGINAL_REGNO (rtx).
         Consume it, we don't set ORIGINAL_REGNO, since we can
         get that from the 2nd copy later.  */
-      if (0 == strncmp (desc, "orig:", 5))
+      if (strncmp (desc, "orig:", 5) == 0)
        {
          expect_original_regno = true;
          desc_start += 5;
@@ -1312,7 +1312,7 @@ function_reader::parse_mem_expr (const char *desc)
 {
   tree fndecl = cfun->decl;
 
-  if (0 == strcmp (desc, "<retval>"))
+  if (strcmp (desc, "<retval>") == 0)
     return DECL_RESULT (fndecl);
 
   tree param = find_param_by_name (fndecl, desc);
index 3e13e4cc2d60008ccc3378684d42936e4b6221bd..b1ef52b9a3d50d5a187eb0a117401e684124c45c 100644 (file)
@@ -1229,7 +1229,7 @@ static int
 parse_reg_note_name (const char *string)
 {
   for (int i = 0; i < REG_NOTE_MAX; i++)
-    if (0 == strcmp (string, GET_REG_NOTE_NAME (i)))
+    if (strcmp (string, GET_REG_NOTE_NAME (i)) == 0)
       return i;
   fatal_with_file_and_line ("unrecognized REG_NOTE name: `%s'", string);
 }
index dae3b027bb387d52f5a84697308fecd993f3db6d..c6664955fe9374ab1c8bdbf78dc8f788b5915d0d 100644 (file)
@@ -1532,8 +1532,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
         value for the incoming operand (same as outgoing one).  */
       if (rld[i].reg_rtx == out
          && (REG_P (in) || CONSTANT_P (in))
-         && 0 != find_equiv_reg (in, this_insn, NO_REGS, REGNO (out),
-                                 static_reload_reg_p, i, inmode))
+         && find_equiv_reg (in, this_insn, NO_REGS, REGNO (out),
+                            static_reload_reg_p, i, inmode) != 0)
        rld[i].in = out;
     }
 
@@ -6750,9 +6750,8 @@ find_equiv_reg (rtx goal, rtx_insn *insn, enum reg_class rclass, int other,
                              && CONST_DOUBLE_AS_FLOAT_P (XEXP (tem, 0))
                              && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
                              && CONST_INT_P (goal)
-                             && 0 != (goaltry
-                                      = operand_subword (XEXP (tem, 0), 0, 0,
-                                                         VOIDmode))
+                             && (goaltry = operand_subword (XEXP (tem, 0), 0,
+                                                            0, VOIDmode)) != 0
                              && rtx_equal_p (goal, goaltry)
                              && (valtry
                                  = operand_subword (SET_DEST (pat), 0, 0,
@@ -6764,8 +6763,8 @@ find_equiv_reg (rtx goal, rtx_insn *insn, enum reg_class rclass, int other,
                      && CONST_DOUBLE_AS_FLOAT_P (XEXP (tem, 0))
                      && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
                      && CONST_INT_P (goal)
-                     && 0 != (goaltry = operand_subword (XEXP (tem, 0), 1, 0,
-                                                         VOIDmode))
+                     && (goaltry = operand_subword (XEXP (tem, 0), 1, 0,
+                                                    VOIDmode)) != 0
                      && rtx_equal_p (goal, goaltry)
                      && (valtry
                          = operand_subword (SET_DEST (pat), 1, 0, VOIDmode))
index baedc43b75f151a1da9e30d1f4b8d4b08b3f2da8..1c94f303d05dbcbc43af1074c5edd89b987ce8a6 100644 (file)
@@ -8006,8 +8006,8 @@ do_output_reload (struct insn_chain *chain, struct reload *rl, int j)
   /* Likewise for a SUBREG of an operand that dies.  */
   else if (GET_CODE (old) == SUBREG
           && REG_P (SUBREG_REG (old))
-          && 0 != (note = find_reg_note (insn, REG_UNUSED,
-                                         SUBREG_REG (old))))
+          && (note = find_reg_note (insn, REG_UNUSED,
+                                    SUBREG_REG (old))) != 0)
     {
       XEXP (note, 0) = gen_lowpart_common (GET_MODE (old), reg_rtx);
       return;
index 77f3fe7cf43066ed1572e154dac10fdfd8aeec02..96778addce52e3527fc6892983bb30907bbcbd0c 100644 (file)
@@ -3205,7 +3205,7 @@ relax_delay_slots (rtx_insn *first)
          && (other = prev_active_insn (insn)) != 0
          && any_condjump_p (other)
          && no_labels_between_p (other, insn)
-         && 0 > mostly_true_jump (other))
+         && mostly_true_jump (other) < 0)
        {
          rtx other_target = JUMP_LABEL (other);
          target_label = JUMP_LABEL (insn);
index ba5b47c73d9a67c19fcc61e89456fa15a8123697..172c6ecfede0328626f29c3cd720a44843dc1b4a 100644 (file)
@@ -3258,10 +3258,10 @@ sched_rgn_init (bool single_blocks_p)
        free_dominance_info (CDI_DOMINATORS);
     }
 
-  gcc_assert (0 < nr_regions && nr_regions <= n_basic_blocks_for_fn (cfun));
+  gcc_assert (nr_regions > 0 && nr_regions <= n_basic_blocks_for_fn (cfun));
 
-  RGN_BLOCKS (nr_regions) = (RGN_BLOCKS (nr_regions - 1) +
-                            RGN_NR_BLOCKS (nr_regions - 1));
+  RGN_BLOCKS (nr_regions) = (RGN_BLOCKS (nr_regions - 1)
+                            RGN_NR_BLOCKS (nr_regions - 1));
   nr_regions_initial = nr_regions;
 }
 
index b6a4b7be8858316b1ac5472804aa613e1e6c16f5..c1be013655158b27bf80ca2cb92023913a2a66d9 100644 (file)
@@ -672,7 +672,7 @@ extract_new_fences_from (flist_t old_fences, flist_tail_t new_fences,
     {
       int seqno = INSN_SEQNO (succ);
 
-      if (0 < seqno && seqno <= orig_max_seqno
+      if (seqno > 0 && seqno <= orig_max_seqno
           && (pipelining_p || INSN_SCHED_TIMES (succ) <= 0))
         {
           bool b = (in_same_ebb_p (insn, succ)
index ca84bfaf43d4f429e2d3609de088cc3ee7f96972..06e451ca2687f3344a2025d05c46a7fbd367c3c9 100644 (file)
@@ -79,7 +79,7 @@ assert_streq (const location &loc,
   if (val_actual == NULL)
     fail_formatted (loc, "ASSERT_STREQ (%s, %s) expected=\"%s\" actual=NULL",
                    desc_expected, desc_actual, val_expected);
-  if (0 == strcmp (val_expected, val_actual))
+  if (strcmp (val_expected, val_actual) == 0)
     pass (loc, "ASSERT_STREQ");
   else
     fail_formatted (loc, "ASSERT_STREQ (%s, %s) expected=\"%s\" actual=\"%s\"",
index 806c3099923bc9acd00a55b24711293a1b9ec101..a6e3cd5507a8f77660765fadd5184c393b0228ae 100644 (file)
@@ -400,8 +400,8 @@ simplify_gen_ternary (enum rtx_code code, machine_mode mode,
   rtx tem;
 
   /* If this simplifies, use it.  */
-  if (0 != (tem = simplify_ternary_operation (code, mode, op0_mode,
-                                             op0, op1, op2)))
+  if ((tem = simplify_ternary_operation (code, mode, op0_mode,
+                                        op0, op1, op2)) != 0)
     return tem;
 
   return gen_rtx_fmt_eee (code, mode, op0, op1, op2);
@@ -416,8 +416,8 @@ simplify_gen_relational (enum rtx_code code, machine_mode mode,
 {
   rtx tem;
 
-  if (0 != (tem = simplify_relational_operation (code, mode, cmp_mode,
-                                                op0, op1)))
+  if ((tem = simplify_relational_operation (code, mode, cmp_mode,
+                                           op0, op1)) != 0)
     return tem;
 
   return gen_rtx_fmt_ee (code, mode, op0, op1);
@@ -5148,7 +5148,7 @@ simplify_const_relational_operation (enum rtx_code code,
       && (code == EQ || code == NE)
       && ! ((REG_P (op0) || CONST_INT_P (trueop0))
            && (REG_P (op1) || CONST_INT_P (trueop1)))
-      && 0 != (tem = simplify_binary_operation (MINUS, mode, op0, op1))
+      && (tem = simplify_binary_operation (MINUS, mode, op0, op1)) != 0
       /* We cannot do this if tem is a nonzero address.  */
       && ! nonzero_address_p (tem))
     return simplify_const_relational_operation (signed_condition (code),
index 559a8e4b8457208c4c8200cd686fb02015c6fb1a..a8cbea9d634b6aa84681159925387ce97f0366d7 100644 (file)
@@ -2665,7 +2665,7 @@ conflict_fn (unsigned n, ...)
   conflict_function *ret = XCNEW (conflict_function);
   va_list ap;
 
-  gcc_assert (0 < n && n <= MAX_DIM);
+  gcc_assert (n > 0 && n <= MAX_DIM);
   va_start (ap, n);
 
   ret->n = n;