From patchwork Wed Jun 28 14:34:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 113937 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8973630vqr; Wed, 28 Jun 2023 07:35:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5B5ZdkM5czHI7eDhPWbwSmlVd6dtAQDpiL1YjMPepaK9I1nh6f+slDVCvBoM70tfgUny5Z X-Received: by 2002:a17:907:b0e:b0:989:450:e565 with SMTP id h14-20020a1709070b0e00b009890450e565mr1513597ejl.23.1687962909222; Wed, 28 Jun 2023 07:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687962909; cv=none; d=google.com; s=arc-20160816; b=R/Mu8eQG5hIox5rte6Y0DmDR1ja4NcuZvYAGwws74E/+v0gOwYhhIzBihMLO+KWpTV 7EkGaTvD5ZpvYRcIBP8bISN+3n5/kj4FKD/4vUAY+sDOSrHUvKMv5dAIOp4FmtfCZaND mwDRBV7vfyrpQfLJAAiz4bEegbA0d/7HitbfMiWrfvJyOZzqO359G4BhGnw8DRJ0pOvh yxMjnFj9/wgXBfinttdi5vxm5XCRuICBjl248pIZbDRFz8H8eO7UBQaJk7rpqWeyRkrx X5BT9PTjEJWJd6+SqzAbZJVoBBHJL8/h0etKbiwHkq9oehjdiBdkJH+sCOSWtryS5yFI dvAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=OKEzsnI2STKdaptztGXFh2IEFGVQNd42ctt20u7Eo2w=; fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=; b=C+1Hmy2P207VljxPioilAsJQokhZd1I0h5iZLeddnicoXWZiAEgZjEgHujslOEJB1u 6TX3ihf49De9y4VsWthBXZUCLQRhEn7/XkHB/WR4ZnT4yZxydK8JRoY7au1hPH4QSWTr vvQLZQgw9yB6VEL6ITlfzrQqoGiHf5lafe22hlQXEY+mLZScqM6mZ5rKDm/vTdWQEP77 tItflbfICMh0/+pNM/la0Eq477F6q5uIO/61TJZ96vL2IU+5kQBofBtJ2SLpUkd4gUUo QIZYiOSfyFpAQGYLnc2kft3CZMRGHTXt7DaKR2ldI7XVXW4MSke7pPQJp9leX9PnNDuR 0EEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Fav4cLMp; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id oy17-20020a170907105100b009924806cd01si1538922ejb.386.2023.06.28.07.35.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 07:35:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Fav4cLMp; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0EE08385840D for ; Wed, 28 Jun 2023 14:35:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EE08385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687962908; bh=OKEzsnI2STKdaptztGXFh2IEFGVQNd42ctt20u7Eo2w=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Fav4cLMpyVLrS0eCWaTDeRm5clAtzi5BcLP853nrlz+IU03Dk93eTAEEUNwmg9R6P cKXbc4WItwNGVGDn0/+Th22mRrqwH9B3IjrYWszxGFTVqIlhursqjiJRKHOD/bDMhg QWg1CnoaHk9YQ6vK1BF51oMu+yn6A4zlPFObouQI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 9D15C3858D35 for ; Wed, 28 Jun 2023 14:34:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D15C3858D35 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-51a52a7d859so1867418a12.0 for ; Wed, 28 Jun 2023 07:34:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687962862; x=1690554862; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OKEzsnI2STKdaptztGXFh2IEFGVQNd42ctt20u7Eo2w=; b=dyzMH7hZxIXuogbIntOQPRrtKAfMNjSb4WosEC47vj1fo+Y9VSG8G7uJ9N6I55zWEz Pi6H76kc6ky2hKUlosIzcXxpxXPELWfH75C1UWZI/gDj67uHJTLZzXh7FQAkfoPp1yxB YMB75DCwzGUaRtBx+vpN3jm7vK6ReXDg4kelIPb9yVyD/aMZQDlaM1ga5h6fFyrCdYsJ 4x4df3GR6griDnKW3GgNkd0tQ+lXX7AyJSWCwCf2f1V2TafN5zg0rdwJaa5PmrOGZyOO KuXFQkwCrBu7Jew97SITD4/GjnA6mCIYSSYmjArkkKfKCvHNP5bEJOW/jyqdmbWPxEJ7 66DA== X-Gm-Message-State: AC+VfDyUnJPX50vi3tUH8z6rrfCsvBhhsJBrMmDc2NEkHIdy8V36ddu8 n5gl3VIKH9xMF6KaGntaQ+aw2KBrr8n2/bkzEVHmruD5BRw1ag== X-Received: by 2002:aa7:c313:0:b0:51b:d59f:8518 with SMTP id l19-20020aa7c313000000b0051bd59f8518mr1460291edq.16.1687962862012; Wed, 28 Jun 2023 07:34:22 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 28 Jun 2023 16:34:10 +0200 Message-ID: Subject: [committed] final+varasm: Change return type of predicate functions from int to bool To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Uros Bizjak via Gcc-patches From: Uros Bizjak Reply-To: Uros Bizjak Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769957395841676922?= X-GMAIL-MSGID: =?utf-8?q?1769957395841676922?= Also change some internal variables to bool and change return type of compute_alignments to void. gcc/ChangeLog: * output.h (leaf_function_p): Change return type from int to bool. (final_forward_branch_p): Ditto. (only_leaf_regs_used): Ditto. (maybe_assemble_visibility): Ditto. * varasm.h (supports_one_only): Ditto. * rtl.h (compute_alignments): Change return type from int to void. * final.cc (app_on): Change return type from int to bool. (compute_alignments): Change return type from int to void and adjust function body accordingly. (shorten_branches): Change "something_changed" variable type from int to bool. (leaf_function_p): Change return type from int to bool and adjust function body accordingly. (final_forward_branch_p): Ditto. (only_leaf_regs_used): Ditto. * varasm.cc (contains_pointers_p): Change return type from int to bool and adjust function body accordingly. (compare_constant): Ditto. (maybe_assemble_visibility): Ditto. (supports_one_only): Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros. diff --git a/gcc/final.cc b/gcc/final.cc index e614491a69a..dd3e22547ac 100644 --- a/gcc/final.cc +++ b/gcc/final.cc @@ -163,9 +163,9 @@ static int insn_counter = 0; static int block_depth; -/* Nonzero if have enabled APP processing of our assembler output. */ +/* True if have enabled APP processing of our assembler output. */ -static int app_on; +static bool app_on; /* If we are outputting an insn sequence, this contains the sequence rtx. Zero otherwise. */ @@ -603,7 +603,7 @@ insn_current_reference_address (rtx_insn *branch) /* Compute branch alignments based on CFG profile. */ -unsigned int +void compute_alignments (void) { basic_block bb; @@ -617,7 +617,7 @@ compute_alignments (void) /* If not optimizing or optimizing for size, don't assign any alignments. */ if (! optimize || optimize_function_for_size_p (cfun)) - return 0; + return; if (dump_file) { @@ -721,7 +721,6 @@ compute_alignments (void) loop_optimizer_finalize (); free_dominance_info (CDI_DOMINATORS); - return 0; } /* Grow the LABEL_ALIGN array after new labels are created. */ @@ -790,7 +789,8 @@ public: /* opt_pass methods: */ unsigned int execute (function *) final override { - return compute_alignments (); + compute_alignments (); + return 0; } }; // class pass_compute_alignments @@ -822,7 +822,7 @@ shorten_branches (rtx_insn *first) int max_uid; int i; rtx_insn *seq; - int something_changed = 1; + bool something_changed = true; char *varying_length; rtx body; int uid; @@ -1103,7 +1103,7 @@ shorten_branches (rtx_insn *first) while (something_changed) { - something_changed = 0; + something_changed = false; insn_current_align = MAX_CODE_ALIGN - 1; for (insn_current_address = 0, insn = first; insn != 0; @@ -1136,7 +1136,7 @@ shorten_branches (rtx_insn *first) { log = newlog; LABEL_TO_ALIGNMENT (insn) = log; - something_changed = 1; + something_changed = true; } } } @@ -1274,7 +1274,7 @@ shorten_branches (rtx_insn *first) * GET_MODE_SIZE (table->get_data_mode ())); insn_current_address += insn_lengths[uid]; if (insn_lengths[uid] != old_length) - something_changed = 1; + something_changed = true; } continue; @@ -1332,7 +1332,7 @@ shorten_branches (rtx_insn *first) if (!increasing || inner_length > insn_lengths[inner_uid]) { insn_lengths[inner_uid] = inner_length; - something_changed = 1; + something_changed = true; } else inner_length = insn_lengths[inner_uid]; @@ -1358,7 +1358,7 @@ shorten_branches (rtx_insn *first) && (!increasing || new_length > insn_lengths[uid])) { insn_lengths[uid] = new_length; - something_changed = 1; + something_changed = true; } else insn_current_address += insn_lengths[uid] - new_length; @@ -4043,9 +4043,9 @@ asm_fprintf (FILE *file, const char *p, ...) va_end (argptr); } -/* Return nonzero if this function has no function calls. */ +/* Return true if this function has no function calls. */ -int +bool leaf_function_p (void) { rtx_insn *insn; @@ -4056,29 +4056,29 @@ leaf_function_p (void) /* Some back-ends (e.g. s390) want leaf functions to stay leaf functions even if they call mcount. */ if (crtl->profile && !targetm.keep_leaf_when_profiled ()) - return 0; + return false; for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { if (CALL_P (insn) && ! SIBLING_CALL_P (insn) && ! FAKE_CALL_P (insn)) - return 0; + return false; if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE && CALL_P (XVECEXP (PATTERN (insn), 0, 0)) && ! SIBLING_CALL_P (XVECEXP (PATTERN (insn), 0, 0))) - return 0; + return false; } - return 1; + return true; } -/* Return 1 if branch is a forward branch. +/* Return true if branch is a forward branch. Uses insn_shuid array, so it works only in the final pass. May be used by output templates to customary add branch prediction hints. */ -int +bool final_forward_branch_p (rtx_insn *insn) { int insn_id, label_id; @@ -4102,10 +4102,10 @@ final_forward_branch_p (rtx_insn *insn) #ifdef LEAF_REGISTERS -/* Return 1 if this function uses only the registers that can be +/* Return bool if this function uses only the registers that can be safely renumbered. */ -int +bool only_leaf_regs_used (void) { int i; @@ -4114,15 +4114,15 @@ only_leaf_regs_used (void) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if ((df_regs_ever_live_p (i) || global_regs[i]) && ! permitted_reg_in_leaf_functions[i]) - return 0; + return false; if (crtl->uses_pic_offset_table && pic_offset_table_rtx != 0 && REG_P (pic_offset_table_rtx) && ! permitted_reg_in_leaf_functions[REGNO (pic_offset_table_rtx)]) - return 0; + return false; - return 1; + return true; } /* Scan all instructions and renumber all registers into those diff --git a/gcc/output.h b/gcc/output.h index 877d2afa55b..76cfd58c1e6 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -128,17 +128,17 @@ extern int sprint_ul (char *, unsigned long); extern void asm_fprintf (FILE *file, const char *p, ...) ATTRIBUTE_ASM_FPRINTF(2, 3); -/* Return nonzero if this function has no function calls. */ -extern int leaf_function_p (void); +/* Return true if this function has no function calls. */ +extern bool leaf_function_p (void); -/* Return 1 if branch is a forward branch. +/* Return true if branch is a forward branch. Uses insn_shuid array, so it works only in the final pass. May be used by output templates to add branch prediction hints, for example. */ -extern int final_forward_branch_p (rtx_insn *); +extern bool final_forward_branch_p (rtx_insn *); -/* Return 1 if this function uses only the registers that can be +/* Return true if this function uses only the registers that can be safely renumbered. */ -extern int only_leaf_regs_used (void); +extern bool only_leaf_regs_used (void); /* Scan IN_RTX and its subexpressions, and renumber all regs into those available in leaf functions. */ @@ -621,7 +621,7 @@ extern void default_elf_internal_label (FILE *, const char *, unsigned long); extern void default_elf_init_array_asm_out_constructor (rtx, int); extern void default_elf_fini_array_asm_out_destructor (rtx, int); -extern int maybe_assemble_visibility (tree); +extern bool maybe_assemble_visibility (tree); extern int default_address_cost (rtx, machine_mode, addr_space_t, bool); diff --git a/gcc/rtl.h b/gcc/rtl.h index 9c6803f043e..098dc4ccc1c 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -4508,7 +4508,7 @@ extern rtx canon_condition (rtx); extern void simplify_using_condition (rtx, rtx *, bitmap); /* In final.cc */ -extern unsigned int compute_alignments (void); +extern void compute_alignments (void); extern void update_alignments (vec &); extern int asm_str_count (const char *templ); diff --git a/gcc/varasm.cc b/gcc/varasm.cc index 542315f88cd..8ae0a2555cd 100644 --- a/gcc/varasm.cc +++ b/gcc/varasm.cc @@ -102,13 +102,13 @@ bool first_function_block_is_cold; static bool saw_no_split_stack; static const char *strip_reg_name (const char *); -static int contains_pointers_p (tree); +static bool contains_pointers_p (tree); #ifdef ASM_OUTPUT_EXTERNAL static bool incorporeal_function_p (tree); #endif static void decode_addr_const (tree, class addr_const *); static hashval_t const_hash_1 (const tree); -static int compare_constant (const tree, const tree); +static bool compare_constant (const tree, const tree); static void output_constant_def_contents (rtx); static void output_addressed_constants (tree, int); static unsigned HOST_WIDE_INT output_constant (tree, unsigned HOST_WIDE_INT, @@ -2419,9 +2419,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED, } } -/* Return 1 if type TYPE contains any pointers. */ +/* Return true if type TYPE contains any pointers. */ -static int +static bool contains_pointers_p (tree type) { switch (TREE_CODE (type)) @@ -2431,7 +2431,7 @@ contains_pointers_p (tree type) /* I'm not sure whether OFFSET_TYPE needs this treatment, so I'll play safe and return 1. */ case OFFSET_TYPE: - return 1; + return true; case RECORD_TYPE: case UNION_TYPE: @@ -2442,8 +2442,8 @@ contains_pointers_p (tree type) for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields)) if (TREE_CODE (fields) == FIELD_DECL && contains_pointers_p (TREE_TYPE (fields))) - return 1; - return 0; + return true; + return false; } case ARRAY_TYPE: @@ -2451,7 +2451,7 @@ contains_pointers_p (tree type) return contains_pointers_p (TREE_TYPE (type)); default: - return 0; + return false; } } @@ -3206,14 +3206,14 @@ tree_descriptor_hasher::equal (constant_descriptor_tree *c1, constant_descriptor_tree *c2) { if (c1->hash != c2->hash) - return 0; + return false; return compare_constant (c1->value, c2->value); } -/* Compare t1 and t2, and return 1 only if they are known to result in +/* Compare t1 and t2, and return true only if they are known to result in the same bit pattern on output. */ -static int +static bool compare_constant (const tree t1, const tree t2) { enum tree_code typecode; @@ -3221,19 +3221,19 @@ compare_constant (const tree t1, const tree t2) if (t1 == NULL_TREE) return t2 == NULL_TREE; if (t2 == NULL_TREE) - return 0; + return false; if (TREE_CODE (t1) != TREE_CODE (t2)) - return 0; + return false; switch (TREE_CODE (t1)) { case INTEGER_CST: /* Integer constants are the same only if the same width of type. */ if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2))) - return 0; + return false; if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))) - return 0; + return false; return tree_int_cst_equal (t1, t2); case REAL_CST: @@ -3244,15 +3244,15 @@ compare_constant (const tree t1, const tree t2) different 128-bit floating point types (IBM extended double and IEEE 128-bit floating point). */ if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2))) - return 0; + return false; if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))) - return 0; + return false; return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2)); case FIXED_CST: /* Fixed constants are the same only if the same width of type. */ if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2))) - return 0; + return false; return FIXED_VALUES_IDENTICAL (TREE_FIXED_CST (t1), TREE_FIXED_CST (t2)); @@ -3260,7 +3260,7 @@ compare_constant (const tree t1, const tree t2) if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2)) || int_size_in_bytes (TREE_TYPE (t1)) != int_size_in_bytes (TREE_TYPE (t2))) - return 0; + return false; return (TREE_STRING_LENGTH (t1) == TREE_STRING_LENGTH (t2) && ! memcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2), @@ -3274,19 +3274,19 @@ compare_constant (const tree t1, const tree t2) { if (VECTOR_CST_NPATTERNS (t1) != VECTOR_CST_NPATTERNS (t2)) - return 0; + return false; if (VECTOR_CST_NELTS_PER_PATTERN (t1) != VECTOR_CST_NELTS_PER_PATTERN (t2)) - return 0; + return false; unsigned int count = vector_cst_encoded_nelts (t1); for (unsigned int i = 0; i < count; ++i) if (!compare_constant (VECTOR_CST_ENCODED_ELT (t1, i), VECTOR_CST_ENCODED_ELT (t2, i))) - return 0; + return false; - return 1; + return true; } case CONSTRUCTOR: @@ -3296,7 +3296,7 @@ compare_constant (const tree t1, const tree t2) typecode = TREE_CODE (TREE_TYPE (t1)); if (typecode != TREE_CODE (TREE_TYPE (t2))) - return 0; + return false; if (typecode == ARRAY_TYPE) { @@ -3307,20 +3307,20 @@ compare_constant (const tree t1, const tree t2) || size_1 != int_size_in_bytes (TREE_TYPE (t2)) || TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t1)) != TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t2))) - return 0; + return false; } else { /* For record and union constructors, require exact type equality. */ if (TREE_TYPE (t1) != TREE_TYPE (t2)) - return 0; + return false; } v1 = CONSTRUCTOR_ELTS (t1); v2 = CONSTRUCTOR_ELTS (t2); if (vec_safe_length (v1) != vec_safe_length (v2)) - return 0; + return false; for (idx = 0; idx < vec_safe_length (v1); ++idx) { @@ -3329,21 +3329,21 @@ compare_constant (const tree t1, const tree t2) /* Check that each value is the same... */ if (!compare_constant (c1->value, c2->value)) - return 0; + return false; /* ... and that they apply to the same fields! */ if (typecode == ARRAY_TYPE) { if (!compare_constant (c1->index, c2->index)) - return 0; + return false; } else { if (c1->index != c2->index) - return 0; + return false; } } - return 1; + return true; } case ADDR_EXPR: @@ -3351,17 +3351,17 @@ compare_constant (const tree t1, const tree t2) { class addr_const value1, value2; enum rtx_code code; - int ret; + bool ret; decode_addr_const (t1, &value1); decode_addr_const (t2, &value2); if (maybe_ne (value1.offset, value2.offset)) - return 0; + return false; code = GET_CODE (value1.base); if (code != GET_CODE (value2.base)) - return 0; + return false; switch (code) { @@ -3392,7 +3392,7 @@ compare_constant (const tree t1, const tree t2) return compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)); default: - return 0; + return false; } } @@ -3760,7 +3760,7 @@ const_rtx_desc_hasher::equal (constant_descriptor_rtx *x, constant_descriptor_rtx *y) { if (x->mode != y->mode) - return 0; + return false; return rtx_equal_p (x->constant, y->constant); } @@ -4377,7 +4377,7 @@ const_rtx_data_hasher::equal (constant_descriptor_rtx_data *x, constant_descriptor_rtx_data *y) { if (x->hash != y->hash || x->size != y->size) - return 0; + return false; unsigned int align1 = x->desc->align; unsigned int align2 = y->desc->align; unsigned int offset1 = (x->offset * BITS_PER_UNIT) & (align1 - 1); @@ -4387,10 +4387,10 @@ const_rtx_data_hasher::equal (constant_descriptor_rtx_data *x, if (offset2) align2 = least_bit_hwi (offset2); if (align2 > align1) - return 0; + return false; if (memcmp (x->bytes, y->bytes, x->size * sizeof (target_unit)) != 0) - return 0; - return 1; + return false; + return true; } /* Attempt to optimize constant pool POOL. If it contains both CONST_VECTOR @@ -6528,30 +6528,32 @@ default_assemble_visibility (tree decl ATTRIBUTE_UNUSED, /* A helper function to call assemble_visibility when needed for a decl. */ -int +bool maybe_assemble_visibility (tree decl) { enum symbol_visibility vis = DECL_VISIBILITY (decl); if (vis != VISIBILITY_DEFAULT) { targetm.asm_out.assemble_visibility (decl, vis); - return 1; + return true; } else - return 0; + return false; } -/* Returns 1 if the target configuration supports defining public symbols +/* Returns true if the target configuration supports defining public symbols so that one of them will be chosen at link time instead of generating a multiply-defined symbol error, whether through the use of weak symbols or a target-specific mechanism for having duplicates discarded. */ -int +bool supports_one_only (void) { if (SUPPORTS_ONE_ONLY) - return 1; - return TARGET_SUPPORTS_WEAK; + return true; + if (TARGET_SUPPORTS_WEAK) + return true; + return false; } /* Set up DECL as a public symbol that can be defined in multiple diff --git a/gcc/varasm.h b/gcc/varasm.h index e6190cae0f8..ff302e8b6f4 100644 --- a/gcc/varasm.h +++ b/gcc/varasm.h @@ -31,7 +31,7 @@ extern tree tree_output_constant_def (tree); extern void make_decl_rtl (tree); extern rtx make_decl_rtl_for_debug (tree); extern void make_decl_one_only (tree, tree); -extern int supports_one_only (void); +extern bool supports_one_only (void); extern void resolve_unique_section (tree, int, int); extern void mark_referenced (tree); extern void mark_decl_referenced (tree);