Message ID | 20231103061849.79159-1-patrick@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:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp831877vqu; Thu, 2 Nov 2023 23:19:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IER8I1ZjbeOCHjBujYLra2WZ2WXLMgUYEKImEwWRpbrTcp1hQvVE/cYCl+f7YMB2+S5u5Zg X-Received: by 2002:a05:620a:6288:b0:774:d3f:c78c with SMTP id ov8-20020a05620a628800b007740d3fc78cmr19730175qkn.72.1698992372966; Thu, 02 Nov 2023 23:19:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698992372; cv=pass; d=google.com; s=arc-20160816; b=GiGCcLgQf7t73XQ3F6MUpIDhXuufN+MNQlyA0nxRmORN04uINI7djrB6ihtxpYlyJX IhsDr3VGgkSvbIN6m3rH8FwPuYfArJlLX+9rZ9kcHSMjth6ZhEwMyM4N/eIoUi1CxZqO 9xid5/AEhDIFp0R79oo+3VoZdmQYbeIRqh8jKiQu+2UyqgtE2qkbovnKXY+GUdZ9u4k9 XSc5fqj6VpfuDMxMQpkDyjdbnwSjpqMfp81ARwt+ruJ75h4EH6KBHzSXyxDQlzL+pSPz c2Y93wGCiwXnnzpAoBw5o++hUyGzTCSCb1ubtTu3YiK5bligWPKs2JdPnYRB9Gz+a5Vc 9l8Q== 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=IMGrtA4KFrNlMxENk7bphuQbYXZ9TwVd7PyphRSPljM=; fh=wDD8OMux2COMFW4+BJzNrgDCSO2RLj1PQnLKR+gld2c=; b=nuBiSmjZ60CJ2hDe5LO5bX6y0B3DjhwVUbiZnZGgsNz3p2cwJSgqY2B2nWiYS9YU/b fuejoEeZmL8sTcOHaULRtFIyix5vS16RSPRCFtteu6ebTn0PVUBq+yPe71HG0EmlbksD ytMg89gtaVQnJaYV8WmUQG3vuLjIL7YmY2LAlt0i8/yC/k6t5uLrmnIQA+COFU8gR9Vy 2fzj6gf2yKX0BP5XHFrySGloz/ax9mhO8BORbqZpwRwBRpUS16EQaCnxriTtp9mSMT06 rVIDkpyAZmBOHLq7aYRYU1jSKL+gyBF/FHe53XSo+id8rDF0JOU+UkO6M7b9Rhwtk20A Xgvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=hNwGyOkU; 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 bq11-20020a05620a468b00b00770728e885bsi1001151qkb.316.2023.11.02.23.19.32 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 23:19:32 -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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=hNwGyOkU; 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 7F68A3858281 for <ouuuleilei@gmail.com>; Fri, 3 Nov 2023 06:19:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id CDB3D3858D39 for <gcc-patches@gcc.gnu.org>; Fri, 3 Nov 2023 06:18:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDB3D3858D39 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 CDB3D3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698992350; cv=none; b=TgTPamF8tR+8xup2TVBjWVz5OWi3tIkz3stHmm4iUv73oLZaewRr849chcFe8EWO5DOU8RtrqGRgxR2D2uxfS15nnBk0tsQBKDqKspwz1prFItxlNIpxFxaFYgKFokaZqxOVoODNnc8oVmUF5MPEEHukE96LZUvIXa60iiQQubM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698992350; c=relaxed/simple; bh=fwZX65n5WCHgeBXH6sjx2FpfXM0XNV4CJjfIA3k/HcE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MKAA0WSfOhgVfGjKweY6v9J8+1on5uqScnz8v5325FE5VdXtPlFiM7aBS9zinLiPHOPIvqNJ8wVZIJcVjHoB/bPaivus36xHdTiDJzlTd/6jsLXMxlNny1SVyo3aDO1vEgu4d8ZsGdAm7PJ79O8yMqS4kPgK/RhqUOg8w8o18iI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5b999980689so1364470a12.1 for <gcc-patches@gcc.gnu.org>; Thu, 02 Nov 2023 23:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698992338; x=1699597138; 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=IMGrtA4KFrNlMxENk7bphuQbYXZ9TwVd7PyphRSPljM=; b=hNwGyOkUCBz7Ulizfwbj3H71gqeKq1iuaKkxViaBkOg7EKFtm+B9CCOzL90vwCrseF r8jCulUZgnarl9AL3ujuBieee7K8t/x9rVfCGPUqtE7Ykd5HBQeaqAg6MsWTyCVqTfgA xNNDYO36+V4lVmHDhnIlJwRL/YcE4VPYT9a6SU6D+iUKEphslfAE/UANg2iulYotiLjy GpurLyPpo70Zayjq2+PQY1s5HWWjoRiwSwO7bpzMgUoIfIgdn2pV0dyPpiDnRLRZkCN1 cGP0caynzNZQwlGQwYF0wTQdl6YYSM6XfYXv9lgfYK0Owdxeyq+slyfjvgvHblRKVCm8 nQKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698992338; x=1699597138; 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=IMGrtA4KFrNlMxENk7bphuQbYXZ9TwVd7PyphRSPljM=; b=s5fI54AUoosd6AiF7nwlEYZ9NbWMuuLnlB4qTTRZ60PBKddwgyI4VtVlp3bkq6t+CF 9DWBoW+tH+KhZXzGB0R0n0+WVpPoKKhIhY5bZYf1tP77+/2ajAWs8+6VhCv2vEO3HZcS f0hwHY5wEOoIatlA54XGjAxmRY9PcSWWw/q8qLNmsn3GYC8ooxIwSvLvUZ56QeTOj8Rt ZAZvpauXLJVcc9V5CgAEgsovl9Xu+0moZOfR96fVSiTvwaeDkALLH+5lJCNASpXYQGNE 9Nv3Um4Er1mIrxof7KrM7mYAC/Qy8QV+kxwpiFF1TJwBtK0rejCDVEAfxWgnG4qRJwLk E1EQ== X-Gm-Message-State: AOJu0YwrnVRdeY6U8khHHWrUt9esE1lqnBQkdLCINxsfyPhLRof5xg0s +s8Wh8QmzOSIbJpcVIEr2WjOlA0M19gF17Y5m4g= X-Received: by 2002:a17:902:dac4:b0:1cc:51b8:80f7 with SMTP id q4-20020a170902dac400b001cc51b880f7mr13174734plx.26.1698992338266; Thu, 02 Nov 2023 23:18:58 -0700 (PDT) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hsd1.ca.comcast.net ([2601:647:5700:6860:43e1:7d0d:cb0:e12a]) by smtp.gmail.com with ESMTPSA id u22-20020a1709026e1600b001b9c5e07bc3sm675530plk.238.2023.11.02.23.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 23:18:57 -0700 (PDT) From: Patrick O'Neill <patrick@rivosinc.com> To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, gnu-toolchain@rivosinc.com, Patrick O'Neill <patrick@rivosinc.com> Subject: [PATCH] g++: Add require-effective-target to multi-input file testcase pr95401.cc Date: Thu, 2 Nov 2023 23:18:49 -0700 Message-ID: <20231103061849.79159-1-patrick@rivosinc.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.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 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: 1781522626711688130 X-GMAIL-MSGID: 1781522626711688130 |
Series |
g++: Add require-effective-target to multi-input file testcase pr95401.cc
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Patrick O'Neill
Nov. 3, 2023, 6:18 a.m. UTC
On non-vector targets dejagnu attempts dg-do compile for pr95401.cc.
This produces a command like this:
g++ pr95401.cc pr95401a.cc -S -o pr95401.s
which isn't valid (gcc does not accept multiple input files when using
-S with -o).
This patch adds require-effective-target vect_int to avoid the case
where the testcase is invoked with dg-do compile.
gcc/testsuite/ChangeLog:
* g++.dg/vect/pr95401.cc: Add require-effective-target vect_int.
Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
---
Tested using rv64gc & rv64gcv to make sure the testcase runs/doesn't
compile as expected.
Somewhat related/similar problem (running vector test on non-vector
target):
https://inbox.sourceware.org/gcc-patches/20231102190911.66763-1-patrick@rivosinc.com/T/#u
https://inbox.sourceware.org/gcc-patches/20231102234527.77231-1-patrick@rivosinc.com/T/#u
Ideally we would have a way to ban a dejagnu dg-do or an equivalent to
check_vect_support_and_set_flags that returns true/false based on
if it emits run/compile as the default dg-do command.
require-effective-target seems to be a reasonable alternative.
pr95401.cc and pr95401a.cc only use int variables and arrays.
---
gcc/testsuite/g++.dg/vect/pr95401.cc | 1 +
1 file changed, 1 insertion(+)
Comments
On 11/9/23 17:34, Jeff Law wrote: > > > On 11/3/23 00:18, Patrick O'Neill wrote: >> On non-vector targets dejagnu attempts dg-do compile for pr95401.cc. >> This produces a command like this: >> g++ pr95401.cc pr95401a.cc -S -o pr95401.s >> >> which isn't valid (gcc does not accept multiple input files when using >> -S with -o). >> >> This patch adds require-effective-target vect_int to avoid the case >> where the testcase is invoked with dg-do compile. >> >> gcc/testsuite/ChangeLog: >> >> * g++.dg/vect/pr95401.cc: Add require-effective-target vect_int. > Sorry, I must be missing something here. I fail to see how adding an > effective target check would/should impact the problem you've > described above with the dg-additional-sources interaction with -S. It's not intuitive (& probably not the cleanest way of solving it). pr95401.cc is an invalid testcase when run with dg-do compile (for the reasons above). pr95401.cc <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/g%2B%2B.dg/vect/pr95401.cc;h=6a56dab095722b01d912416352df17f0d91dfd27;hb=HEAD> does not define a dg-do, which means it uses the testcase uses dg-do-what-default <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/g%2B%2B.dg/vect/vect.exp;h=fc77120a83173c65ad147e8bb7c29ac82f06bb6d;hb=HEAD#l30> to determine what to do. dg-do-what-default is set by target-supports.exp <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/testsuite/lib/target-supports.exp;h=1a7bea96c1e4ccb8ef30ac7012c04e8d44c5ad01;hb=HEAD#l11532>. The two options here are set dg-do-what-default run or compile. On non-vector targets the pr95401 is set to compile (which is invalid). Ideally we would say if dg-do-what-default == compile don't run, but AFAIK that isn't possible. I didn't want to duplicate the check_vect_support_and_set_flags logic to return true/false since that'll probably get out of sync. I used require-effective-target vect_int as a proxy for check_vect_support_and_set_flags (also since the testcase only contains integer arrays). That way we do this now: dg-do-what-default run -> run dg-do-what-default compile -> skip test If there's a cleaner/better approach I'm happy to revise. Patrick > > Jeff >>
diff --git a/gcc/testsuite/g++.dg/vect/pr95401.cc b/gcc/testsuite/g++.dg/vect/pr95401.cc index 6a56dab0957..6a1b65ff0e7 100644 --- a/gcc/testsuite/g++.dg/vect/pr95401.cc +++ b/gcc/testsuite/g++.dg/vect/pr95401.cc @@ -1,5 +1,6 @@ // { dg-additional-options "-mavx2 -O3" { target avx2_runtime } } // { dg-additional-sources pr95401a.cc } +// { dg-require-effective-target vect_int } extern int var_9; extern unsigned var_14;