From 59067ddf66e71bd1bab92a9f581d01657286382c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 20 Mar 2024 11:46:07 +0100 Subject: Use integer_{zero,one}_node some more When looking at the analyzer MEM_REF invalid second arg issue, I've noticed tons of build_int_cst (integer_type_node, {0,1}) or build_zero_cst (integer_type_node) cases. That just wastes compile time (albeit not very much). The following patch fixes what my sed script found. 2024-03-20 Jakub Jelinek gcc/analyzer/ * constraint-manager.cc (test_range, test_constraint_conditions, test_constant_comparisons, test_constraint_impl, test_purging, test_bits): Use integer_zero_node instead of build_zero_cst (integer_type_node) or build_int_cst (integer_type_node, 0) and integer_one_node instead of build_int_cst (integer_type_node, 1). * region-model.cc (region_model::get_store_value, append_interesting_constants, test_array_1, test_get_representative_tree, test_unique_constants, test_assignment, test_stack_frames, test_constraint_merging, test_widening_constraints, test_iteration_1, test_array_2): Likewise. gcc/cp/ * coroutines.cc (expand_one_await_expression): Use integer_zero_node instead of build_int_cst (integer_type_node, 0) and integer_one_node instead of build_int_cst (integer_type_node, 1). gcc/fortran/ * trans-array.cc (structure_alloc_comps): Use integer_zero_node instead of build_zero_cst (integer_type_node) or build_int_cst (integer_type_node, 0) and integer_one_node instead of build_int_cst (integer_type_node, 1). * trans-expr.cc (conv_scalar_char_value): Likewise. * trans-stmt.cc (gfc_trans_form_team, gfc_trans_change_team, gfc_trans_sync_team, gfc_trans_sync): Likewise. * trans-decl.cc (create_main_function): Likewise. * trans-intrinsic.cc (trans_this_image, conv_intrinsic_move_alloc): Likewise. * trans.cc (gfc_allocate_using_caf_lib, gfc_deallocate_with_status): Likewise. gcc/objc/ * objc-next-runtime-abi-02.cc (build_v2_class_ro_t_initializer): Use integer_zero_node instead of build_int_cst (integer_type_node, 0). --- gcc/objc/objc-next-runtime-abi-02.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/objc') diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc index b3de6d7..cdf559b 100644 --- a/gcc/objc/objc-next-runtime-abi-02.cc +++ b/gcc/objc/objc-next-runtime-abi-02.cc @@ -3244,7 +3244,7 @@ build_v2_class_ro_t_initializer (tree type, tree name, explicitly declare the alignment padding. */ /* reserved, pads alignment. */ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, - build_int_cst (integer_type_node, 0)); + integer_zero_node); /* ivarLayout */ unsigned_char_star = build_pointer_type (unsigned_char_type_node); -- cgit v1.1