From patchwork Tue Jun 6 17:22:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1791338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=pT9tbgWI; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QbHPc6djhz20QH for ; Wed, 7 Jun 2023 03:23:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D5FE3858280 for ; Tue, 6 Jun 2023 17:23:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D5FE3858280 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686072209; bh=nGKN1hH/DPlPW/MeWeINXRBKWk2gUMvRo5SjtvbPe1Q=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=pT9tbgWIyYa+9PkhMx3K6Jes7S8ntv7jr+RP6ODVoERJkM6MimosrnsJ3Pnu6Wqkw E04BmVFzPG+/DI0wdDywXhl9Tbom5IKhRNovnD8l+JQqBrWUjkEH89Lw62NRW48bGQ B8haDBqJiZEppHnsEU1MbSC2hUsBJBDpwfS8ddKM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by sourceware.org (Postfix) with ESMTPS id 1E1E13858D38 for ; Tue, 6 Jun 2023 17:23:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E1E13858D38 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-62b67937a6cso3335446d6.3 for ; Tue, 06 Jun 2023 10:23:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686072189; x=1688664189; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nGKN1hH/DPlPW/MeWeINXRBKWk2gUMvRo5SjtvbPe1Q=; b=D6AQQPDNS5cL5AC890Ozctao1i7QUNo990HYqUNbh8r3B3WL6y3Ev7IRffaxOdFw2g dW1dzEbhB79bCR4z6DJSOGzJ+h7J7Ze2dHIaqZWPCc70JetVVX7+mGrlMmUO6psRATNU hnFlEEeDJ4UT+Ttfxcvv9xB19vla8/SIFXc4iL3SJwkOLWRbHsBl5Bdr8ha5CK98Jeys NsTwwcny0XysAxBOos0ACMUd1AHD4MT/3KUuSJq6FTyrCA6/aijB+QXV+O9m2GhJ64ho uN1fW9qP/RLU6qggW3+y7bxDnHYNp8ev1A/oPOOZWC+FtzjDXEkUNM/aFogEdinbL/3n EB1g== X-Gm-Message-State: AC+VfDz/drQSxpGnaNbQaYRpAF8NAIAKPYMLnnpWB4alX/izZptcL9Kc 9jWmv/Rp38rTZtAjPbdu6s0p9kGRuZVfuI2kntdNFECYU25x/Q== X-Google-Smtp-Source: ACHHUZ72NCYcnWHMyuRbmST1rkIGbBAmXw4lA/PCVRDbdE63aOjMqcdbVdorLiI26yHmsEoXv4UqUNpdD2JcqC96VGU= X-Received: by 2002:a05:6214:21cd:b0:5f1:6892:7449 with SMTP id d13-20020a05621421cd00b005f168927449mr280737qvh.28.1686072189123; Tue, 06 Jun 2023 10:23:09 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 6 Jun 2023 19:22:57 +0200 Message-ID: Subject: [COMMITTED] reload1: Change return type of predicate function from int to bool To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.4 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: * rtl.h (function_invariant_p): Change return type from int to bool. * reload1.cc (function_invariant_p): Change return type from int to bool and adjust function body accordingly. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros. diff --git a/gcc/reload1.cc b/gcc/reload1.cc index 9ec2cb9baf4..9ba822d1ff7 100644 --- a/gcc/reload1.cc +++ b/gcc/reload1.cc @@ -5949,14 +5949,14 @@ free_for_value_p (int regno, machine_mode mode, int opnum, return 1; } -/* Return nonzero if the rtx X is invariant over the current function. */ +/* Return true if the rtx X is invariant over the current function. */ /* ??? Actually, the places where we use this expect exactly what is tested here, and not everything that is function invariant. In particular, the frame pointer and arg pointer are special cased; pic_offset_table_rtx is not, and we must not spill these things to memory. */ -int +bool function_invariant_p (const_rtx x) { if (CONSTANT_P (x)) diff --git a/gcc/rtl.h b/gcc/rtl.h index 4c993e82708..988691f5710 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -4307,7 +4307,7 @@ extern void fix_register (const char *, int, int); extern const HARD_REG_SET *valid_mode_changes_for_regno (unsigned int); /* In reload1.cc */ -extern int function_invariant_p (const_rtx); +extern bool function_invariant_p (const_rtx); /* In calls.cc */ enum libcall_type