From patchwork Wed Jan 24 00:50:37 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: 191265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp696352dyi; Tue, 23 Jan 2024 16:52:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IG98q+IInPW6T4pahZStnxX9S3yjRTLniOGKxhbZTf3fzdliwpHTa3MQ74rNPWVzJBLCkzo X-Received: by 2002:a05:620a:4626:b0:783:a6e5:3184 with SMTP id br38-20020a05620a462600b00783a6e53184mr3083158qkb.60.1706057528797; Tue, 23 Jan 2024 16:52:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706057528; cv=pass; d=google.com; s=arc-20160816; b=E0C5coLogQ8mX1GiyLRwhKUfMEMeQV52UFIgom2MgAVfakWWov9md5N3t1iZiywM7L p9kA+eR7MA9+EId3KL7peycAIMYg0t+fQOCIjcgCD8QIyQcl80kB1IhdS7M7lTH7Fj5o 8iXqY6KRHDl0I2Y2qxiBq9N21TdaDbu6kU9aclWsPU7tucKsSupcgS9Y9xnjYjQkdC82 dmhIucR+GlCsiek5DXktr1m31bYmgJXa801n60gKaYY0fsBS5q9YuXvwesJV9CJOuOcn 5vZ/cy2jUtv+uujEkq4QkGxmTAdFC0zPlHNuKx50/8h5pyvZPCumbNZ+5q/+0H8tJ3Mk bqog== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=IBcK8X8muAh+taFUFdCEfcwAbCXobC8dWAyFR6nlmN0=; fh=FfCCJvlQF1umXJihnofAsKhv6fZIT9nM12z0SJNN1os=; b=cWY1c1Ud0avfoW6AlP5RmW1uZ4uq6Q9NplzKqFGGhfbc78BGk3z/NKO/2iVLrPBMES ZEUVxGDvF4jA6lxsRCXbSGa8zUhr9IzRGbQolZbHYPmjpj/r2dZKo18JA6Ktv+n4GG/6 QePPaX7LJdrrKm0XPCS4kJ+M78IB0K8Yql2Bra1KPFmwWcDFau8axV9ryTYpP1moZgaS 3aXkfljgC6FB/YwZsr+dIKaxpQ8ED1UStxQK6tydykzSUcHqaC4nQQpydgyteplrevyC vIb2bGgn3VGdOVg3xSg2hvhvdVbFH3jkJ6EkZ+EBYa0DL/xn1+pDnYbJn/39bx7ONBXy cfpQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=2zqIlHWC; 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 y14-20020a05620a44ce00b007815ba075f6si9686376qkp.310.2024.01.23.16.52.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 16:52:08 -0800 (PST) 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=2zqIlHWC; 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 7FEF3386183D for ; Wed, 24 Jan 2024 00:52:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 0AE343861807 for ; Wed, 24 Jan 2024 00:51:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AE343861807 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 0AE343861807 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706057482; cv=none; b=iw58gL6wLmGNbBrULlg59DTHVPJ5yZ8xKMESSuEDmRNABZq1zb3Q/ZcpnxuCFqwh+Dfy3Q1VVCmqWNlZqKuwZP3vpLpzo0uq585s/19ZCdpH01xOg0NYboUdUklzMyv/ZJyZpip6Z8gZCMteR93GkbgmlWMRwjQ6QdCGzGJwESY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706057482; c=relaxed/simple; bh=BQQyX27BxVJ2MX869HyZMWO5j51Vt3Uulhw027nAW9Q=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XtOyhzVBKWGMPliD0eZiXni3RFV/TgQIsD7wLym1kj2JW22HgzfVGVn35btc/6Fpzoqv1/vJNepqK2dG2oeVlKrGqsp52TWYS1c7CaBPnnWLgnCU26PrMJ8F8nnVuPdrBuicMz3kO2C7IpMOZX3RQEAuH3Ukky4laLuFp0cMz7M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6da9c834646so4959609b3a.3 for ; Tue, 23 Jan 2024 16:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706057478; x=1706662278; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IBcK8X8muAh+taFUFdCEfcwAbCXobC8dWAyFR6nlmN0=; b=2zqIlHWCwNk7zUL+l0+G2wXqVdl5S1KXmL0MWfBQ5Lsh5c69J89tgn0s5AsRDA4a7u bwg0CwXIYqycz9Qv7FOd8500/NifaVPSnq/YdEuV141dtsAyOph+jgRtbbi26LAe6aUV qQLrWuo9FS0F9IU+7LhO1usQudUlg59/b1s5cy8AU4+dGozFAYzggp+gR5CLWKLPm4FQ yteFMVkrV7U4K70vtyv9rwEYINJPmJc31q4Zn3yDD+kdGYRvzASmfAk5poQMUc94IXkl NO3oNJ4yVLFRyiu/xfzti05i2lFNY3s8wvSJPVbcBR+s/wt5Kb+rKANq7YfgG//qxuPj fBsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706057478; x=1706662278; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IBcK8X8muAh+taFUFdCEfcwAbCXobC8dWAyFR6nlmN0=; b=B3GGxJ+AorGYCQP0FQ50Ud3cs3/ihvX/hUB8XIy7Y4sdglIESmcaHS6fvWWYmLaWQq nSxiB3usLAhTfXOr53z9BPy9HMcLpZ4counsTOcoJJq0wIYpsgKMT2fDLwPmtswEmFYB idoXQ9m+wPOstmouVyB0J938wN07JWpPitCPfNlPzK4/h9wVGGhAOvn9RYfYs0nmS4qI 0k2xWgYtFTeyH+nk+1fPYSwT50I6aIpDn1FaumQPylKyfEx5+TcukGd26rOIUFDzvA8N 3821CAVrbBuP0cmZaZtItLjOG6l0bk/701jV4uAemO+8Zdvwm0mp/Rsx/rElgoIEgTE0 ejwA== X-Gm-Message-State: AOJu0Yxju8msH2OUHi1RpCS+j2HaOhJgV4C77lQaDvCDgCuiFctO9k09 R15YMDQypDHAzyw3FfBtMu/vot3CRkxzJGSGJ/7oDjWQrnb3vVZuL5jGIBwes9Q9nJClV/1WAcU f X-Received: by 2002:a62:5887:0:b0:6db:a1f9:a7b0 with SMTP id m129-20020a625887000000b006dba1f9a7b0mr6874290pfb.21.1706057478166; Tue, 23 Jan 2024 16:51:18 -0800 (PST) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hq.rivosinc.com ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id n10-20020a056a000d4a00b006db05a51868sm12765031pfv.99.2024.01.23.16.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 16:51:17 -0800 (PST) From: Patrick O'Neill To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, law@gcc.gnu.org, rdapp@gcc.gnu.org, vineetg@gcc.gnu.org, Patrick O'Neill Subject: [PATCH] RISC-V: Add regression test for vsetvl bug pr113429 Date: Tue, 23 Jan 2024 16:50:37 -0800 Message-ID: <20240124005038.140542-1-patrick@rivosinc.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: 1788930978843580709 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 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 --- .../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; +}