From patchwork Tue Apr 30 20:36: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: 1929854 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=l8WxigZ+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VTX7W5cBMz23jG for ; Wed, 1 May 2024 06:37:27 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FB333858404 for ; Tue, 30 Apr 2024 20:37:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 9F8A83858D34 for ; Tue, 30 Apr 2024 20:37:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F8A83858D34 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 9F8A83858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714509429; cv=none; b=Eo5uNR7+euf7LZ2hGlGvPf/aS3Gnz2wdbaEQtpJXPQSHTAcGveB2qqsM5vnBP9JtaRXCJS7B7pMZq/tqQXI+JMqRIfZn99dHji1wCE1h1fzxp6SWS2wDLtK3vbN4g44b2OD2Ds+qkaR4xb19mCB7jcrdaqtBFTbjKx/ndHRjN9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714509429; c=relaxed/simple; bh=tglLW9rsLzPtVl7O8348XjaoWY8gzn7k2sZJObm+uGw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=G196M8TPEd1CQG6O0xnpSCSk2cr8/JqKHErdQDgj7Pg7lA/7b960WIan7PocW1DxNhGC4BqBBzsodS7/yRyl4RRzP816Omizlll6ruVa3KTRmqvj93tn8aTeY+tyH49mCa09CIWbbjP3qMcGBncXN/Gt6est+p7nMlcDp4GZsBw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6eff2be3b33so5709692b3a.2 for ; Tue, 30 Apr 2024 13:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1714509426; x=1715114226; 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=5zEGou8y7JRr06bX86CP8qsBbSgm8BYArkWnp3NZtQs=; b=l8WxigZ+7dfN8PbzBBbZslT/tpXcMggLJZ6p8B0iPEX5/lViFLKWFt+DZQAq2MzeTN /n3uBIeh4cRpquctI8mCbetTqoPadqHuLlu891bI9cUYoDGkk85lw2WxvErNtdCn2ZrF ePhQANLpnyGUu5QrxLiWSbTzes2wyRoat1nGBT3owKURMwBfCSe1We0jMvFu2eIxmApo 7L5y8OLD535yYebVv7PfmWG0B/aOtH7C7uFpei4OpBYtlI58lG3q+2kKn7uTbzzM5yts nesx4Kf9SWLDFUaw9Q3SzlvV/vPaaq4/g2gZUOvAkYkfnqJPE7XDl9fNdycyW6dHRFYh 4QCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714509426; x=1715114226; 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=5zEGou8y7JRr06bX86CP8qsBbSgm8BYArkWnp3NZtQs=; b=ZGtJA5e7aV+a1V31HBRtC8AkRy6eaLpULIwUJfUruU8zyVnpZWDI4HL+J8DaC4Z5Zo QHe6lrPX41/RaFqmvYPCxRYUvPvmSuxvgpnuInBjYJezbOpUcKlwDxWfgohnbJEWthAh H6+VjyNBjoCMK7atW0dXfC0VP7UhNNpIsXLCznK+vDfnp2VSapC0ETTq0LPfcTVF+HCO Jy/dehqkWymhKVYp+cN0vHOvW/RNe1xNLw8iAKrT9iaL2Qu5gyLc3MyVtt0QYZ4mkpmN 9ni8EQCzbGchoQUgkp5a8hSHo5uV/arM46h4VE3XQh1i5duH3h3/6r6cfJuzD2jqG3qq 5kBA== X-Gm-Message-State: AOJu0YxHkLoWlxEQ+nHMZn+2EeSylxn4V1h2mzD26P1H8T+xxAeSYMak +xAmkRxTa18wiqZ5bNXnfrsBb1o0T0saIYmLjokh9mvjJ8Lb35Ro6m1sYahjWgBJxBLpHA30ynP 8 X-Google-Smtp-Source: AGHT+IEfz9LoeT/4i3OKsvycejlKgzgIM9llOXEMMIVeb5tlZhhLcq0eeqP1uqG1PLgW2P8Z/V3sGw== X-Received: by 2002:a05:6a20:1041:b0:1af:66aa:f96a with SMTP id gt1-20020a056a20104100b001af66aaf96amr749681pzc.1.1714509425760; Tue, 30 Apr 2024 13:37:05 -0700 (PDT) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hq.rivosinc.com ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id t15-20020aa78f8f000000b006ed92b011desm21565525pfs.169.2024.04.30.13.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 13:37:05 -0700 (PDT) From: Patrick O'Neill To: gcc-patches@gcc.gnu.org Cc: rdapp.gcc@gmail.com, rguenth@gcc.gnu.org, Patrick O'Neill Subject: [PATCH] RISC-V: Add testcase for pr114734 Date: Tue, 30 Apr 2024 13:36:42 -0700 Message-ID: <20240430203642.4189814-1-patrick@rivosinc.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 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 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+incoming=patchwork.ozlabs.org@gcc.gnu.org gcc/testsuite/ChangeLog: PR middle-end/114734 * gcc.target/riscv/rvv/autovec/pr114734.c: New test. Signed-off-by: Patrick O'Neill --- Tested on rv64gcv before and after Richard Biener's fix: 4d3a5618de5a949c61605f545f90e81bc0000502 --- .../gcc.target/riscv/rvv/autovec/pr114734.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/pr114734.c diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr114734.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr114734.c new file mode 100644 index 00000000000..b605d992aa1 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr114734.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target riscv_v } */ +/* { dg-options { -march=rv64gcv_zvl256b -mabi=lp64d -fwhole-program -O3 -mrvv-vector-bits=zvl } } */ + +int f[18]; +int g[18]; +int h[18][18][18]; +int a[324]; +long b[18]; +int *i = g; +int (*j)[18][18] = h; +int z; +int main() { + for (int m = 0; m < 18; ++m) + f[m] = 3; + for (int m = 0; m < 18; m += 1) + for (int n = 0; n < 18; n += 3) { + a[m * 8 + n] = j[m][m][0] ? i[n] : 0; + b[n] = f[n] ? -i[m] : 0; + } + for (long n = 0; n < 8; ++n) + z = a[n]; + if (b[15] != 0) + __builtin_abort(); +}