From patchwork Wed Jan 24 01:20:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick O'Neill X-Patchwork-Id: 191281 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp708793dyi; Tue, 23 Jan 2024 17:21:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGktRBoiRrPgA/2y7Wzqsq9T+tDm+Rlpw8uos5ycNNcVPkGKfJnxuKVBvT2irRS+wRKpMsZ X-Received: by 2002:a05:6808:ece:b0:3bd:9875:a5c1 with SMTP id q14-20020a0568080ece00b003bd9875a5c1mr859761oiv.73.1706059296725; Tue, 23 Jan 2024 17:21:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706059296; cv=pass; d=google.com; s=arc-20160816; b=c8P9GOC/UmJnRAsCe2m499eMzAG8v+ew+XJPUYd54pCCFCFrUY2s+QlpvjSf+Zr3ut rqHEJLx8lj0hLSspdVMuThXEATLygkZpPxDexPzU1c1ePj6/J9kl8IzAEl1m2jU7+Hpn AphiSSpCmaLlI72+BdY109Y5W1ENpXr4c08NQwnLfkK06YSfJH+158DD7nQ18+1vL58O Q5dKWQR35KmQnUOPvz36yPBPZABkYwJtCPmYD5bqCrYJjEU0PDR9Ws0+S0TmnLtW+yuq fIltgoZGkZ5QM94hipOvI/8otLxfI4BSy8CfDob4z1qHDD4yK6+IexcZaxK4v8Tf/ad0 1RkA== 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:in-reply-to:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=ux7wCG4jPpjf2xiEXRbUi6RPkPCQphD1apDyQRvHHaw=; fh=ou7i5BTzhgNFVIWwiRo0chkxXk/hRDfZCdUBSqwc5iU=; b=PwD8Et8UzDCCU2WaRvuvTYTZHTdT3s7mX1Az/6Oum5O0MpNHJ0pL4w/nhjahgWfAC9 N3rzC4UuIkpO6H/Rj6+iE5EtCD0BKkoF6Ngtb8Pg5vr8jEplzaayDxNadE43/f2abc8D mMKJ667++5FgFlLYEaWT+gfiXqLghdDVOvKCrDCdRyXKBG+8DEma8mOBzguE0byqhtdL u9mt0c6U0e0oWgzHu77q+mPnchixM3gv0FNWSS6+gt2dCKqaF15jm3tQTl6Owq9ApeJ7 VCVkJpsLne9mdlP0kpfnNrKNUVcIIGXxLrv3pSSdrD9ptk7x1TpcFcAMuSvEU9lSvVLJ mCFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=wJKwcJsa; arc=pass (i=1); 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" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b7-20020a05622a020700b0042a3cdaec69si6077893qtx.112.2024.01.23.17.21.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 17:21:36 -0800 (PST) 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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=wJKwcJsa; arc=pass (i=1); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 63A4A3858425 for ; Wed, 24 Jan 2024 01:21:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 419EA3858C20 for ; Wed, 24 Jan 2024 01:20:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 419EA3858C20 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 419EA3858C20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706059247; cv=none; b=GDsbu7gSoF/xZvtcxCZcw2LTEgFL7xPBiokmBIT/LD7yY+V9urDj458YX/afn/4agdwJfAiBJ5+dptpCoQYkyVzttpAFOPx9n2NqA3iP/ugzQeTqh9+ECpRxvJPTDm/pEOQmnJaWiaXXlkawScFBYHx5+ZVs4f2LKUtcpXaFu6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706059247; c=relaxed/simple; bh=buu5Fi4jpq02KCDsyWzy9e2X3QZu4tU/4/e0D24oKTQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ukESU5izgjfUVrGxMxYs9fvCZjAVLm000L0VNs8YHQX3efX1+4jsqGJmB49aH+u8NYahAW46djX+6/n5YHNM0dKF43C10Y80Kqgt2xp5MIGmAdY9/K2Igm79PcMFWy9+TjHCK0A7Ny3xsD121sP33e79zL6nN1BO8u7W7foJmdE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6dd839abbf7so963942b3a.2 for ; Tue, 23 Jan 2024 17:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706059244; x=1706664044; darn=gcc.gnu.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=ux7wCG4jPpjf2xiEXRbUi6RPkPCQphD1apDyQRvHHaw=; b=wJKwcJsaXZ4TxlKXf7GbebEJ9KO9x6XkpMtnujMlwk+6EOfDjqDpCJASm1knBa7xCI BicVuxdZkJ2H/oWhpCDKl7QMRJYInzzUrMgsOx8cdJ43E8zzPKdEZlHqFDjXVlcXjb2r H2iFokDhT2HuVtHW1h/wlVjXdaWMY6XMN+lHDO/0UJBAP3RqWCcMTKpkokOq9eJMWIjD J55pb2YH48u3FIduLhdRc1ib7AqgbZUw59gy/eI2pD8H+j+RI0hhGnpyUttYYinWwOLE IvxhJmnSGyslV0ezEgVMdUgznrwkOIEm8vdBvnoZzxMyVMVD6RNiay5ql6jt1sxIQyHu dIzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706059244; x=1706664044; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ux7wCG4jPpjf2xiEXRbUi6RPkPCQphD1apDyQRvHHaw=; b=PtYBvLIWiQf+7eWtKZKaLYrXgtYSZ7wlrZuyThmlmVI2RGYTeKORCdwZcno8oB4LG2 E+tCzUlXqhgGdfs/ukstQI17JDgSbSkQLDlJ/oX+brp7p9Q85fEYBlr8lgpVbLDYeavy Acs8u45MV5W7N4+gqM2+hgzjOeRFU0bPQ0ZilpLupMduMxB+hb8VZrgfnL05Pc3eMRaH UAf4zPaABnaK9G6pUMosHgGcEaXbBTVXGdhx1GiH9h2xxYMMk0aSv3W+FiSH2r0vmu5L NayhDI1GWvZCo34h4tML6qY0uI/7dibTcaYKNJZkyAOT41y8URewbhuIlnI9OIcFOAvm WKqg== X-Gm-Message-State: AOJu0Yx7YrHo5Pwf6wEUquVbXPe0zapC0PgdMoGq777aJiC/Su+pWNao jUyk8wkYKUSTziYHfLRqpXjMOpLBoYDRn9rwh2mV0spGRlFWOxh/htbnw19RWdU= X-Received: by 2002:a05:6a00:4b41:b0:6d9:b5ce:f17e with SMTP id kr1-20020a056a004b4100b006d9b5cef17emr8814220pfb.5.1706059244121; Tue, 23 Jan 2024 17:20:44 -0800 (PST) Received: from [10.0.17.156] ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id g8-20020a635208000000b005cfbef6657fsm6803696pgb.58.2024.01.23.17.20.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jan 2024 17:20:43 -0800 (PST) Message-ID: <369f3c41-731f-4698-bc20-ae8f1c1a836b@rivosinc.com> Date: Tue, 23 Jan 2024 17:20:42 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [Committed] RISC-V: Add regression test for vsetvl bug pr113429 Content-Language: en-US To: "juzhe.zhong@rivai.ai" , gcc-patches Cc: "kito.cheng" , law , rdapp , vineetg References: <20240124005038.140542-1-patrick@rivosinc.com> From: Patrick O'Neill In-Reply-To: X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, HTML_MESSAGE, KAM_NUMSUBJECT, KAM_SHORT, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788930978843580709 X-GMAIL-MSGID: 1788932833112540424 The reduced testcase for pr113429 (cam4 failure) needed additional modules so it wasn't committed. The fuzzer found a c testcase that was also fixed with pr113429's fix. Adding it as a regression test. PR target/113429 gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/pr113429.c: New test. Signed-off-by: Patrick O'Neill Signed-off-by: Patrick O'Neill Signed-off-by: Patrick O'Neill --- .../gcc.target/riscv/rvv/vsetvl/pr113429.c | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr113429.c diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr113429.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr113429.c new file mode 100644 index 00000000000..05c3eeecb94 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr113429.c @@ -0,0 +1,70 @@ +/* { dg-do run } */ +/* { dg-options "-march=rv64gcv_zvl256b -mabi=lp64d -O3" } */ + +long a; +int b, c, d, e, f, g; +short h, i, j; +static int k = 3; +static int l = 6; +int m[5][7]; +signed char n; +int *const o = &c; + +signed char(p)(signed char p1, signed char q) { + return p1 / q; +} + +void s(unsigned p1) { + b = (b ^ p1) & 255; +} + +static long t() { + long u; + signed char v; + d = 1; + for (; d <= 4; d++) { + j = 0; + for (; j <= 4; j++) { + v = 0; + for (; v <= 4; v++) { + if (m[v][v]) + continue; + c = 0; + for (; c <= 4; c++) { + n = 0; + for (; n <= 4; n++) { + int *w = &e; + long r = v; + u = r == 0 ? a : a % r; + h |= u; + *w = g; + --m[n][c]; + f &= *o; + } + } + if (p((i < 3) ^ 9, k)) + ; + else if (v) + return 0; + } + } + } + return 1; +} + +static char x() { + for (;;) { + t(); + if (l) + return 0; + } +} + +int main() { + x(); + s(e & 255); + if (b == 0) + return 0; + else + return 1; +}