From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id B55673858D37 for ; Thu, 25 May 2023 21:17:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B55673858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-64d577071a6so294007b3a.1 for ; Thu, 25 May 2023 14:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1685049454; x=1687641454; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qNIRlsI5c+QbmpI13HX9ebPT0jim7zhSzVRJe4l1C9Y=; b=4SFLB144IcZNnGxN6Stw0Ke6xm/hifHuF1aeeJSNZs3GCRH6zVRaaiKt52dI2WQ5Qi qCV6r19jHv4huhf3P2htelrp/iiAzQEH2U3lF8j2KTuXf1ua5V1pEESDgkhJMzXQmbsj 2KZS6YQKi5k7eGfX5V4m2NPmu3LbcWU+KKpY7fchyHU94yDl/Qj3IJ19GbZwzz7mhnyK UuOm+GGcIBwk7EEqwWEy63uQRV9MBUPomA7Q3QSe6XArKoGKbieFSRrWmtiir5UOoTy5 D47Ia5hgqbEblYSLs4B5L6NRMpNIqTbJAz+ubqssCG9OoY/10UZAP+fcsV8BSvnuW8H+ a8Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685049454; x=1687641454; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qNIRlsI5c+QbmpI13HX9ebPT0jim7zhSzVRJe4l1C9Y=; b=NliIqqG+aft6YEA0buKl3WRaUKDbydnVYQwuDb6pFN595tdmJ5+MF8rSWDqwUc2FNf mGfcKHy4Zli4uT98OhUDOZoTiNnQXN3UKYruwK8g4agPweBDUI4a3xPlyK3PdstsmaJY WZqDYv6UqsVC0mN6W3R5cQSF9To015raB+pMtX6MAYmebuN3xQpsCpCxj0Zqh7g8TLtr FOYGIgCCDwF8Ii8jYsAQIEQOtvOjerRrJhhQj3/taH1qbckjzJYBeWNryN1o/AAcU0Cc A/u+E1Cf1qJLClxppxn/gVRfafKQEA7QG1/U4DaNBSWWSFLNFq2qJIBuOtCzCTHbpMf0 2CZw== X-Gm-Message-State: AC+VfDy7XpNS+cuVqXptkmHa3q0OIZVdh5bE2l0Av1RnHYWykFZCh+K5 ipM+ysxKEG4Qh+rKbP6oOidCxA== X-Google-Smtp-Source: ACHHUZ5aAs4knFHxjWn9OTmluq9Nd3+c3m7rijTtz3TAaiSxG1pcETMfXN4smfxg0ilwdzfk2JUYYQ== X-Received: by 2002:a05:6a20:394d:b0:10c:7916:f9f8 with SMTP id r13-20020a056a20394d00b0010c7916f9f8mr12483323pzg.6.1685049453666; Thu, 25 May 2023 14:17:33 -0700 (PDT) Received: from [10.0.16.165] ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id j11-20020aa783cb000000b0063f0c9eadc7sm1526490pfn.200.2023.05.25.14.17.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 May 2023 14:17:33 -0700 (PDT) Message-ID: <1bfe6de8-8510-4c30-7b2d-f22a599e750d@rivosinc.com> Date: Thu, 25 May 2023 14:17:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] RISC-V/testsuite: Run target testing over all the usual optimization levels To: Thomas Schwinge , Kito Cheng , "Maciej W. Rozycki" Cc: GCC Patches , Andrew Waterman , Kito Cheng , patrick@rivosinc.com, jlaw@ventanamicro.com, Palmer Dabbelt References: <87edn4ruzi.fsf@dem-tschwing-1.ger.mentorg.com> Content-Language: en-US From: Vineet Gupta In-Reply-To: <87edn4ruzi.fsf@dem-tschwing-1.ger.mentorg.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,KAM_SHORT,LIKELY_SPAM_BODY,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Thomas, On 5/25/23 13:56, Thomas Schwinge wrote: > Hi! > > On 2022-02-08T00:22:37+0800, Kito Cheng via Gcc-patches wrote: >> Hi Maciej: >> >> Thanks for doing this, OK to trunk. >> >> On Tue, Feb 1, 2022 at 7:04 AM Maciej W. Rozycki wrote: >>> Use `gcc-dg-runtest' test driver rather than `dg-runtest' to run the >>> RISC-V testsuite as several targets already do. Adjust test options >>> across individual test cases accordingly where required. >>> >>> As some tests want to be run at `-Og', add a suitable optimization >>> variant via ADDITIONAL_TORTURE_OPTIONS, and include the moderately >>> recent `-Oz' variant as well. >>> >>> * testsuite/gcc.target/riscv/riscv.exp: Use `gcc-dg-runtest' >>> rather than `dg-runtest'. Add `-Og -g' and `-Oz' variants via >>> ADDITIONAL_TORTURE_OPTIONS. >>> As to adding `-Og -g' and `-Oz', this should probably be done globally in >>> gcc-dg.exp, but such a change would affect all the interested targets at >>> once and would require a huge one-by-one test case review. Therefore I >>> think adding targets one by one instead is more feasible, and then we can >>> switch once all the targets have. >>> --- gcc.orig/gcc/testsuite/gcc.target/riscv/riscv.exp >>> +++ gcc/gcc/testsuite/gcc.target/riscv/riscv.exp >>> @@ -21,6 +21,8 @@ if ![istarget riscv*-*-*] then { >>> return >>> } >>> >>> +lappend ADDITIONAL_TORTURE_OPTIONS {-Og -g} {-Oz} >>> + >>> # Load support procs. >>> load_lib gcc-dg.exp > Per my understanding, that is not the correct way to do this. See > 'gcc/doc/sourcebuild.texi': > > [...] add to the default list by defining > @var{ADDITIONAL_TORTURE_OPTIONS}. Define these in a @file{.dejagnurc} > file or add them to the @file{site.exp} file; for example [...] > > Notice '.dejagnurc' or 'site.exp', that is: globally. (Doing this > "globally in gcc-dg.exp" -- as you'd mentioned above -- would work too, > conditionalized to '[istarget riscv*-*-*]' only, for now, as you > suggested.) > > Otherwise, per what we've not got, either of the following two happens: > before any other 'load_lib gcc-dg.exp', 'gcc.target/riscv/riscv.exp' > happens to be read first, does set 'ADDITIONAL_TORTURE_OPTIONS', then > does its 'load_lib gcc-dg.exp' -- which then incorporates > 'ADDITIONAL_TORTURE_OPTIONS' for *all* (!) following '*.exp' files as > part of that 'runtest' instance. Alternatively, any other '*.exp' file's > 'load_lib gcc-dg.exp' comes first (without the desired > 'ADDITIONAL_TORTURE_OPTIONS' being set), and once > 'gcc.target/riscv/riscv.exp' is read, while it then does set > 'ADDITIONAL_TORTURE_OPTIONS', its 'load_lib gcc-dg.exp' is a no-op, as > that one has already been loaded, and therefore the > 'ADDITIONAL_TORTURE_OPTIONS' aren't incorporated. > > Instead, I suggest to do this locally: do 'load_lib torture-options.exp', > 'torture-init', 'set-torture-options [...]' (where that includes your > special options), 'gcc-dg-runtest', 'torture-finish'. See other '*.exp' > files. > > > (No, I didn't invent this interface.) > > > (I however don't see yet how this would be related to the current > "ERROR: torture-init: torture_without_loops is not empty as expected" > discussion, as has, kind of, been claimed in > > "RISC-V: Add missing torture-init and torture-finish for rvv.exp" and the > following.) Thanks for taking a look at this. Please don't get me wrong, never mean to vilify the patches above - and I should have verified first (by reverting those) if they caused the issue - if at all. It just seemed that we started seeing these relatively recently and the timing of your changes seemed to coincide. As you say above, RV likely has existing less than ideal constructs which somehow used to work before, but not in the new regime. Anyhow the goal is to get this fixed for RV and any more help will be appreciated since I'm really a TCL noob. It seems my claim yesterday that adding torture-{init,finish} fixed RV issues were just premature. I was trying a mix of running the full suite vs. justĀ  RUNTESTFLAGS="riscv.exp" and in some cases latter can give a false positive (I was making sure dejagnu got rebuilt and rekicked etc, but anyhow different issue). I'm currently removing the ADDITIONAL_TORTURE_OPTIONS to see if this helps cure it and then try the new sequence you pointed to above. FWIW if you want to test this out at your end, it is super easy. |git clone https://github.com/riscv-collab/riscv-gnu-toolchain toolchain-upstream cd toolchain-upstream git submodule init git submodule update ||./configure --with-arch=rv64imafdc --with-abi=lp64d --enable-multilib --enable-linux --prefix= make -j make report-linux SIM=qemu Thx, -Vineet |||