From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 34A263858D32 for ; Sun, 19 Nov 2023 04:08:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 34A263858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 34A263858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700366940; cv=none; b=Q1PvxX2Srs1M6lnbZQKKg+XU7pP70C760IE8z7AEHHLpU6HSbEht0/cTtxn9XuEH0qk//WDm1hSau35/jRNPp23sde3dGclxTGAAI8rf2u7OF/8TXHhLWa42cv1wS9FPgJwlh+1+JrC2F2fYw486JWVxz7Kd7j0HjxcuM0DufiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700366940; c=relaxed/simple; bh=4wEYUCiOvsXjHxFlURxd32E/2+4ergrZR8K6+mPNPAg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ly4ytZXy+C4Htfb1GUp0I9qRx3lDZkIjf4fWrLmKLT4ZvjVo9+1ZoMb577GfzSsKehrAZG34AzmTciJk7hHMy5DikKEkvoakeIYjEqWkm3Zqq5inJjxMfi3W6f1zDvgHJjEBvnr57XDXn6PkDXUbOWVHRIAC93WY38sO8Smxn0Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1e9bb3a0bfeso2047650fac.3 for ; Sat, 18 Nov 2023 20:08:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700366937; x=1700971737; darn=gcc.gnu.org; h=content-transfer-encoding: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=wdA2pPDaTKnpfJZg/YWERBIcuewiLxvrR14XXGgJTVM=; b=mYgoQqEtbaXa1chv5obrCesxbTY8MZ3/sIBs2jXGhcaaZKQRkLtRJqrIhPfpDU26iY 0SA2CN3foHEjTHjlFrtNPzf51uievSSWfZ2ABusXMqb5ecfVv+tdJIIWp5fJTxhui3mg g6Z28DtxGjrkh1CzkEak+JP9+E/6Frv47wcIeLa449pSqqODRSZihfs0q4Uf3ChTK8SG few720RNgKJtYPYhSWSbCxS+Qsfpj4vG3eDdZCwHQ72j6/TffOyXmsPmiwnIAtEql4cm JCkRTUjjLzpYBZ0oVgtss0zowOhX1s15Bwk/kWcXXgLUYvmaOdFqN7ZwOAOQRQOUrKlK lm3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700366937; x=1700971737; h=content-transfer-encoding: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=wdA2pPDaTKnpfJZg/YWERBIcuewiLxvrR14XXGgJTVM=; b=W14h6InBzOml19qWq6CKWgp+EF0C49tisJKBKnniPq0dmJAHI9BTLaUPxDPwlpMW/z FxpXNyq7pTC/wRIF4pnrn2A/ADTPofwj4CNQt50+tk1rZYjiWOYlmKBfM9b9Uv1tcWag v3GwCqOzl1wYbenTjpJz7X2v3FBJehQ3febMdLOzcFWJlfdvqF2rUvXZ1o0suhiZDqj7 WQYBuphNjJ2LYYqZssIUutaqB5JGU7ATymHV5a6vaMSvwc6LcwpoXd9HvR9wGSlPXMsL 0nmyWeRGrIrj7Hsg61BGR8B+ZIwz3nGPPrIleKUN88r+tmwgn+gpDJneX+AvJ3yahB0T arSQ== X-Gm-Message-State: AOJu0YyYsaYxYx9mgvOZFngIIuqlLf+zo1fxEWIH2eeyUbAY8vWhYJAi 4sxylAcBEeu3AXEnVRB+gHwdT3oRmcmEXw== X-Google-Smtp-Source: AGHT+IEi96Wv2ghRR8ovmWFhwMRHWow7P5mKuPsVhvL2GoAL0ZOgQIl9IoIILd7K4FdjukBSamdrAQ== X-Received: by 2002:a05:6871:7a8a:b0:1e9:9469:a858 with SMTP id pd10-20020a0568717a8a00b001e99469a858mr4234410oac.39.1700366937159; Sat, 18 Nov 2023 20:08:57 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id zj31-20020a0568716c9f00b001dd8c46ed49sm861476oab.8.2023.11.18.20.08.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Nov 2023 20:08:56 -0800 (PST) Message-ID: Date: Sat, 18 Nov 2023 21:08:55 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] g++: Add require-effective-target to multi-input file testcase pr95401.cc Content-Language: en-US To: Patrick O'Neill , gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com References: <20231103061849.79159-1-patrick@rivosinc.com> <7e78cd70-70c9-41b1-8a98-6977a103429e@rivosinc.com> From: Jeff Law In-Reply-To: <7e78cd70-70c9-41b1-8a98-6977a103429e@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: On 11/10/23 11:00, Patrick O'Neill wrote: > > 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 > does not define a dg-do, which means it uses the testcase uses dg-do-what-default to determine what to do. > dg-do-what-default is set by target-supports.exp > . > > 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. Another approach would be to make this a run test -- without actually running the vector bits. ie, set it up so that it can safely run on any target. volatile bool x = false; main() { if (x) call the vector function that already exists exit (0); } Though that may run afoul of other issues. So if you want to go forward with your patch, that's fine, just add a comment about how adding the effective-target test works around the problem. Thanks for the detailed explanation, jeff