Message ID | 20230806125010.283900-7-c@jia.je |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp910700vqr; Sun, 6 Aug 2023 05:53:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF62QC6tnmzHLlFNkFsSw+rDarVGhrs+pcyg7/bEQhNzCpG2Ft4RmAsWS0c9U+PoHtyXbJa X-Received: by 2002:a17:906:1015:b0:99c:ad52:b00 with SMTP id 21-20020a170906101500b0099cad520b00mr4924729ejm.6.1691326384834; Sun, 06 Aug 2023 05:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691326384; cv=none; d=google.com; s=arc-20160816; b=wlF0xirTiZdHQkr97FvRf/zAZl3qCic4Bgoxs5TJqvpbF5YhytnwlXhJxJ1NaDr8AO xEJ4CCEtCo+gdlpsMpnrnsUXlzguBwRlkDi9Ti/IIlHUxtE7Uq96JTPHWm2VJysHlJrO GWTzjTZB8cHylTLdVnx09yh+scpK89be3WQNjF2C85nb8BRYK1rm+lxydK2KNb7/dwGv fMrnEMjxqnXdA28tRAGYA03+PlOAp5F4TMrAUgymgYZwFTH3o73P9K/SAzxo6yLhuKsK 8Ls6LC3FWLHxDWAiGhykXFiXtkvBuLWgwcIIXzyaLzs+z2YjAsKvY7feoJ1MSAOhrY/u apTA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=XXSJxqgZfAf65b18Vl5wFtTJMTCQ8GKybS9G+z5BD8c=; fh=cE5jVtj7gUY33yQFQBuNLHSg4tYpKtHOPxV+JSFpEWE=; b=ZMCwKRdHbl1/UDkYztSxk0lAwGX5w49V6mX+mqa2FOsfsmQdpwWESsyCL/Y/GKCEo9 vBKpkbqGd889VMsv0q6RXolIQyPFX4O/qfUi1gIZAkdUc5L2HeppY1+htuvPNGGpFV0M GCg9HliOMIPDp/mOzt896hR1TPc33fp8/LJo7HIGp3L51IccsPzOmqS8K3ZDj2jj6RHS JI4aj2CS9q/TPyRqvVHFusth7cXqiSeTKWMI6yX9p9S4lwIQgd/qtwjtl+VgdsmPoOqd Km8Up5KumLdXis6CBSpx4l3XzZdlGOV7xtpo44zJYjbzsvMb5gR72qA639xzXRgUXLRW kM1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TY0j4RNe; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id i20-20020a170906115400b00993470682e9si3168868eja.739.2023.08.06.05.53.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 05:53:04 -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=TY0j4RNe; 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 48F5E385382B for <ouuuleilei@gmail.com>; Sun, 6 Aug 2023 12:52:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48F5E385382B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691326323; bh=XXSJxqgZfAf65b18Vl5wFtTJMTCQ8GKybS9G+z5BD8c=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=TY0j4RNeQVb2kv4coSF0vcbIIsAiRujZuNf/D4RtgdVPDbDZ0p/lLEDComZT4ntPz b5onaAN5SGQztJm/8FYKPrBJGyKncLjuGtoRpDqlEp3+bP1sa35k8CwDsxEcKycDN8 nsqgGaK1bviA3PLLSU9WhHnSlGU01x5FnuOuWlvo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from hognose1.porkbun.com (hognose1.porkbun.com [35.82.102.206]) by sourceware.org (Postfix) with ESMTPS id 7F1393857C71 for <gcc-patches@gcc.gnu.org>; Sun, 6 Aug 2023 12:51:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F1393857C71 Received: from cslab-alder.. (unknown [166.111.226.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: c@jia.je) by hognose1.porkbun.com (Postfix) with ESMTPSA id EA26341D82; Sun, 6 Aug 2023 12:51:15 +0000 (UTC) To: gcc-patches@gcc.gnu.org Cc: Jiajie Chen <c@jia.je> Subject: [PATCH 7/9] LoongArch: Fix signed 32-bit overflow for loongarch32 target Date: Sun, 6 Aug 2023 20:50:04 +0800 Message-ID: <20230806125010.283900-7-c@jia.je> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806125010.283900-1-c@jia.je> References: <20230806125010.283900-1-c@jia.je> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jiajie Chen via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jiajie Chen <c@jia.je> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773484255427096312 X-GMAIL-MSGID: 1773484255427096312 |
Series |
[1/9] LoongArch: Introduce loongarch32 target
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jiajie Chen
Aug. 6, 2023, 12:50 p.m. UTC
When rhs equals to 0x7fffffff, adding 1 to rhs overflows SI, generating invalid const_int. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_emit_int_compare): Call trunc_int_mode to ensure valid rhs. --- gcc/config/loongarch/loongarch.cc | 1 + 1 file changed, 1 insertion(+)
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index ff7904d49d5..5a9c99afc99 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -4283,6 +4283,7 @@ loongarch_emit_int_compare (enum rtx_code *code, rtx *op0, rtx *op1) break; new_rhs = rhs + (increment ? 1 : -1); + new_rhs = trunc_int_for_mode (new_rhs, GET_MODE (*op0)); if (loongarch_integer_cost (new_rhs) < loongarch_integer_cost (rhs)) {