Message ID | 20231101215132.879718-1-vineetg@rivosinc.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp730243vqx; Wed, 1 Nov 2023 14:52:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnDNXseVkliagTJau+80XRAtcdWvi7FblrPULH/z7pTq370qOPnlTM0lQfvvVvdfqHeRT+ X-Received: by 2002:a25:404d:0:b0:d9a:5918:8f53 with SMTP id n74-20020a25404d000000b00d9a59188f53mr14927478yba.56.1698875535410; Wed, 01 Nov 2023 14:52:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698875535; cv=pass; d=google.com; s=arc-20160816; b=lf0D14TLNil98czVQidSB4K5q19wkBKDLYoC77wVnLdPhD4rUlYQv94BV9uEKOQyUI nzZxe+Nsv1VuvkJXWML2L8Pf2TAj8a/CBVXPWPdD+udWLocskIXMF2aou9pf+B1ewHxb 6VGDJW1yEAuqPWoqwyoEQgQ8QW4IVnY8ddyR+QKUb9CRPLKIK4bBAg+0BTktTbD1kjdN zMs9+rIIXPFCfp8/1ReKLpzAtI/Id5kvpPyEsGaISWWdp3o8YG/FL3k6+YheO9yLmvDr GLsS5r3dxSLNSje41Fw5B5AckUa/oNl525Rc6pKjrjsbjWtioXICNOglRA6Ix1UmogfO B2qg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to: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 :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=ysET4gx6WE60VNOhujkAl67QOrWNI7xHYclLsWubUP0=; fh=HJJ7MZKRRlaD4t6Smr6gt1wrUsqf9TXvC584m6E4BVI=; b=PkvvtjegGo2yKMiHna4+3wbuH+kUN/+3g+jA1xcMbZJsiyYhXp/wwiqSC8GguHeUk/ rMTOm+FZD9duglxlKK8SIzFW9soFy7eO2Ttdb1JG3FrSc/WvnETgZgcH/hehEf5CuMue QXSw3/VFOAMyikhRZWaJB+EIGfefUvjdSOXX6/hJjCLd9+9wQo5lQdKkgBB/IqD95gNw eInGwhJ2/4kVVaPYYA2Ze/cyqpJY7lwR3YSsdHhtJZa8WrFCAbk6lxzO6TvGdbMbVYtk sj/vnmW4msbl5fBHL8kWuP4hVTbTFlRSI9ZRoJ79zPJWJzIXRKzmqhjuc0Xi+xbpgya0 JZmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=fMT7hoGS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x3-20020a0ce783000000b006709ee177f3si3383901qvn.231.2023.11.01.14.52.15 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 14:52:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=fMT7hoGS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A6023858C2C for <ouuuleilei@gmail.com>; Wed, 1 Nov 2023 21:52:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id 6F4243858D28 for <gcc-patches@gcc.gnu.org>; Wed, 1 Nov 2023 21:51:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F4243858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F4243858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698875508; cv=none; b=GcfBoyRGdaLkv3UIrgDOch4O+2t7bvVoINxdc0Kk/AdWR92kId3bOUHt/o6+Hl1FfmFXP9yrVbRtHCGfls7VPgpqe0jpA+tjYLInzJoSruhXuRsdY4sezh/vHuZUPW7gyws6aZwpBjfwa100nqfDUYQeOJvASAhmRhkHDmIz9uE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698875508; c=relaxed/simple; bh=JRYcLcFdI9ynxNAFeBiFlwG3FfzLUxUTYq7JiTXwQGo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=PB1PywGtYlMXIOBEMWljuiO6dlKqfK/wOfFpdKSc8ZpMGvaJ/pmpF437pQer1BJDsYcKLGxiLCZLv9z3OB+7alNrmB/Oulg/tD/HeKktqOObAET9iqDpFfIeadE36XZs/4YPoIg908M7HH+Kpvfl+wsvrstnDjVAHsHXfvCJA68= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1f00b95dc43so199571fac.3 for <gcc-patches@gcc.gnu.org>; Wed, 01 Nov 2023 14:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698875494; x=1699480294; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ysET4gx6WE60VNOhujkAl67QOrWNI7xHYclLsWubUP0=; b=fMT7hoGSvI448SaaqZlgBfA8E2bLJOpzr27zF5lYzSzvTtMwjBiRQJqQrSS7j2HbQa w9m/+myUj+fM32hap7sYZ9qc8XEfTOASAdoGoqEifcXx5KQkmCcm5s/2LFDGmESLhLhI m8li82iqIVBVEFJFQoHetvFkYCm77JzGuddR109QDL1FH2uJ300HESdhYIa4mrHvBcEv ksJRZY7fF3m5Wy0ZZwtS5U4SbAIJErsZxHBJhhmnWkCqTh3zlBBH3tWtNLEgqcmB3w18 0hgPWYBT61BtFxRD76C26LLLi9WSkTzY11Vbf8oJyKbzgHEJN2ww7D7Sdii6u8yvr+/o qF1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698875494; x=1699480294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ysET4gx6WE60VNOhujkAl67QOrWNI7xHYclLsWubUP0=; b=e0F0tlkbjlfvvIcn41k4RI4Rh+3fPc6phjgDXffdhpMhnFOlXtJrQicwnwL1VpHZNN e0p5nHTVeLu/iSLbZgOw5lEtI5hvHaUpKTQAZkUqR46ZwC02Hzyv8fxNBjLjyguS9gd9 QDYv9CAZrhWua9qTb0d4C+JeJUOLxn9EoMMewxuoVa4ON3qJ0fcw8vMuc1Qca/Hra6jI HAiNcbA2wNDpo9k3+VAe8+A9BeOhPksOdeROMq6A4Ubq9ZJEb6RY/GgD+/Td9c8igA1t T55LNtWL85w4QfB3QJamoDbZkwe6QpalR6CAtGXcbUbbSZVMrABdpk04X8AAWcU3CuSX QSzg== X-Gm-Message-State: AOJu0YwzhM9PaZAqZW37ZRNs/+OUyJ5EoRdM8HUjNkVJ0mvZA5uJ8Rkm od20nE0kIIety9Uwx1vbVPEoUIYcucDmL/j3akstkg== X-Received: by 2002:a05:6870:1309:b0:1ea:7bd1:c495 with SMTP id 9-20020a056870130900b001ea7bd1c495mr16219709oab.27.1698875494526; Wed, 01 Nov 2023 14:51:34 -0700 (PDT) Received: from vineet-framework.ba.rivosinc.com (c-73-170-212-163.hsd1.ca.comcast.net. [73.170.212.163]) by smtp.gmail.com with ESMTPSA id i129-20020a639d87000000b005b96b42f7ccsm305352pgd.82.2023.11.01.14.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 14:51:34 -0700 (PDT) From: Vineet Gupta <vineetg@rivosinc.com> To: gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com, Vineet Gupta <vineetg@rivosinc.com>, Patrick O'Neill <patrick@rivosinc.com> Subject: [[Committed]] RISC-V: fix TARGET_PROMOTE_FUNCTION_MODE hook for libcalls Date: Wed, 1 Nov 2023 14:51:32 -0700 Message-Id: <20231101215132.879718-1-vineetg@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cf0f26de-4ddd-439b-857d-67abe390107f@gmail.com> References: <cf0f26de-4ddd-439b-857d-67abe390107f@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK 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.30 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> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781297142072050497 X-GMAIL-MSGID: 1781400113410033812 |
Series |
[[Committed] ] RISC-V: fix TARGET_PROMOTE_FUNCTION_MODE hook for libcalls
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Vineet Gupta
Nov. 1, 2023, 9:51 p.m. UTC
Fixes: 3496ca4e6566 ("RISC-V: Add runtime invariant support") riscv_promote_function_mode doesn't promote a SI to DI for libcalls case. It intends to do that however the code is broken (regression). The fix is what generic promote_mode () in explow.cc does. I really don't understand why the old code didn't work, but stepping thru the debugger shows old code didn't and fixed does. This showed up when testing Ajit's REE ABI extension series which probes the ABI (using a NULL tree type) and ends up hitting the libcall code path. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_promote_function_mode): Fix mode returned for libcall case. Tested-by: Patrick O'Neill <patrick@rivosinc.com> # pre-commit-CI #526 Signed-off-by: Vineet Gupta <vineetg@rivosinc.com> --- gcc/config/riscv/riscv.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 0148a4f2e431..895a098cd9a6 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -8630,9 +8630,10 @@ riscv_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, return promote_mode (type, mode, punsignedp); unsignedp = *punsignedp; - PROMOTE_MODE (as_a <scalar_mode> (mode), unsignedp, type); + scalar_mode smode = as_a <scalar_mode> (mode); + PROMOTE_MODE (smode, unsignedp, type); *punsignedp = unsignedp; - return mode; + return smode; } /* Implement TARGET_MACHINE_DEPENDENT_REORG. */