From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 996A5385842C for ; Wed, 7 Jun 2023 11:52:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 996A5385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686138731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WgtdYXZT+TbGbryljCq1GFjjeZsW1rYrYsRlTY4uFqM=; b=BvN1gw9j9mSwxajVSAHfOYisTiAN6kv5p3awF5jFaBhDRCNd7VvcGaWJrN8+0TFYDyAaYX WuOmzrqWznbERRQiWnqiHp9vx9Yvx1EdgLGd1LFYCx386+x9BON7ITISOnxz1UX7+A0HYl 21yxCTdaq5ZRdYasJl0V8EidehDLODs= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-gns1ildCNg2P-vrzMlCt9A-1; Wed, 07 Jun 2023 07:52:09 -0400 X-MC-Unique: gns1ildCNg2P-vrzMlCt9A-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-4f617f00f27so2982835e87.2 for ; Wed, 07 Jun 2023 04:52:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686138728; x=1688730728; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WgtdYXZT+TbGbryljCq1GFjjeZsW1rYrYsRlTY4uFqM=; b=CnmS1tSayH4zBt5vSIO1Ip2NAKMvO13ni5BtReUdLuCrjMe2Q+UonxlcWvLbgv6Nxe aT0/YH5LppcenQXxnz1kDn5GJPmsvQWQyjs3CKt5qBOWt0AkUjcdZSeZ+gBaiVYaKAqH HCJeVvbt/LUg5L3+u59Nwk0B9LFTrT9bcbh2O42D6rN9F3KbD80skrk6jqwQ+3Hje+jo 8DfXeoeVL7/JaSGc2yoAWMUXI1cMpZ7E25Zr5ezntBfljdKPfc03yoQcK2JaSIy+e01f xmVuFcXR2+hszXrV5HaJ3j5H+HZqeA+2en8NSCF5NfuRPDnfigwQH6gHQEwgV7ggpwtu W2KA== X-Gm-Message-State: AC+VfDz0S7CwcKo+lm+LME18nJQ6hK+10rpr9lw0QqCB6sZkJKcpz3D/ YZepDGSN8rDEjEMKPWkgNNDiwtb6gccBdRgGBoPd5R+RPb9ML2xaI2ZGE+iSpwNtmrvVQJbSajz qyO8oQBVd022fYez+ZvTD3fTED9J52LVOsUDXr8OqPQ== X-Received: by 2002:a2e:98ca:0:b0:2af:2441:f709 with SMTP id s10-20020a2e98ca000000b002af2441f709mr2399936ljj.29.1686138728379; Wed, 07 Jun 2023 04:52:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IQAS0HIHs462hc9YtRQH9Qpy4/nbwg+xvLkFrKmMgocavqgdaCgFQy+YYeUlVQ4/eeklxPo0LKGelWFHs/pE= X-Received: by 2002:a2e:98ca:0:b0:2af:2441:f709 with SMTP id s10-20020a2e98ca000000b002af2441f709mr2399926ljj.29.1686138727994; Wed, 07 Jun 2023 04:52:07 -0700 (PDT) MIME-Version: 1.0 References: <873534qu9e.fsf@euler.schwinge.homeip.net> <87y1kvpwxo.fsf@euler.schwinge.homeip.net> <87v8fzprld.fsf@euler.schwinge.homeip.net> In-Reply-To: <87v8fzprld.fsf@euler.schwinge.homeip.net> From: Jonathan Wakely Date: Wed, 7 Jun 2023 12:51:56 +0100 Message-ID: Subject: Re: Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions') To: Thomas Schwinge Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, Jozef Lawrynowicz X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000eca8d405fd88c35f" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,URI_HEX 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: --000000000000eca8d405fd88c35f Content-Type: text/plain; charset="UTF-8" On Wed, 7 Jun 2023 at 10:08, Thomas Schwinge wrote: > Hi! > > On 2023-06-07T09:12:31+0100, Jonathan Wakely wrote: > > On Wed, 7 Jun 2023 at 08:13, Thomas Schwinge wrote: > >> On 2023-06-06T20:31:21+0100, Jonathan Wakely > wrote: > >> > On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge > > >> > wrote: > >> >> This issue comes up in context of me working on C++ support for GCN > and > >> >> nvptx target. Those targets shall default to '-fno-exceptions' -- > or, > >> >> "in other words", '-fexceptions' is not supported. (Details omitted > >> >> here.) > >> >> > >> >> It did seem clear to me that with such a configuration it'll be hard > to > >> >> get clean test results. Then I found code in > >> >> 'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-prune': > >> >> > >> >> # If exceptions are disabled, mark tests expecting exceptions to > be > >> >> enabled > >> >> # as unsupported. > >> >> if { ![check_effective_target_exceptions_enabled] } { > >> >> if [regexp "(^|\n)\[^\n\]*: error: exception handling > disabled" > >> >> $text] { > >> >> return "::unsupported::exception handling disabled" > >> >> } > >> >> > >> >> ..., which, in a way, sounds as if the test suite generally is meant > to > >> >> produce useful results for '-fno-exceptions', nice surprise! > >> >> > >> >> Running x86_64-pc-linux-gnu (not yet GCN, nvptx) 'make check' with: > >> >> > >> >> RUNTESTFLAGS='--target_board=unix/-fno-exceptions\{,-m32\}' > >> >> > >> >> ..., I find that indeed this does work for a lot of test cases, > where we > >> >> then get (random example): > >> >> > >> >> PASS: g++.dg/coroutines/pr99710.C (test for errors, line 23) > >> >> -PASS: g++.dg/coroutines/pr99710.C (test for excess errors) > >> >> +UNSUPPORTED: g++.dg/coroutines/pr99710.C: exception handling > >> disabled > >> >> > >> >> ..., due to: > >> >> > >> >> [...]/g++.dg/coroutines/pr99710.C: In function 'task my_coro()': > >> >> +[...]/g++.dg/coroutines/pr99710.C:18:10: error: exception > handling > >> >> disabled, use '-fexceptions' to enable > >> >> [...]/g++.dg/coroutines/pr99710.C:23:7: error: await expressions > >> are > >> >> not permitted in handlers > >> >> compiler exited with status 1 > >> >> > >> >> But, we're nowhere near clean test results: PASS -> FAIL as well as > >> >> XFAIL -> XPASS regressions, due to 'error: exception handling > disabled' > >> >> precluding other diagnostics seems to be one major issue. > >> >> > >> >> Is there interest in me producing the obvious (?) changes to those > test > >> >> cases, such that compiler g++ as well as target library libstdc++ > test > >> >> results are reasonably clean? (If you think that's all "wasted > effort", > >> >> then I suppose I'll just locally ignore any FAILs/XPASSes/UNRESOLVEDs > >> >> that appear in combination with > >> >> 'UNSUPPORTED: [...]: exception handling disabled'.) > >> > > >> > I would welcome that for libstdc++. > >> > >> Assuming no issues found in testing, OK to push the attached > >> "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ > >> testing"? > >> (Thanks, Jozef!) > > > > Yes please. > > Pushed commit r14-1604-g5faaabef3819434d13fcbf749bd07bfc98ca7c3c > "Support 'UNSUPPORTED: [...]: exception handling disabled' for libstdc++ > testing" > to master branch, as posted. > > For one-week-old GCC commit 2720bbd597f56742a17119dfe80edc2ba86af255, > x86_64-pc-linux-gnu, I see no changes without '-fno-exceptions' (as > expected), and otherwise: > > === libstdc++ Summary for > [-unix-]{+unix/-fno-exceptions+} === > > # of expected passes [-15044-]{+12877+} > # of unexpected failures [-5-]{+10+} > # of expected failures [-106-]{+77+} > {+# of unresolved testcases 6+} > # of unsupported tests [-747-]{+1846+} > > As expected, there's a good number of (random example): > > -PASS: 18_support/105387.cc (test for excess errors) > -PASS: 18_support/105387.cc execution test > +UNSUPPORTED: 18_support/105387.cc: exception handling disabled > > ..., plus the following: > > [-PASS:-]{+FAIL:+} 23_containers/vector/capacity/constexpr.cc (test > for excess errors) > > > [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101: > error: non-constant condition for static assertion > In file included from > [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:6: > > [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:101: > in 'constexpr' expansion of 'test_shrink_to_fit()' > [...]/libstdc++-v3/testsuite/util/testsuite_hooks.h:56: error: > '__builtin_fprintf(stderr, ((const char*)"%s:%d: %s: Assertion \'%s\' > failed.\012"), ((const > char*)"[...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc"), > 92, ((const char*)"constexpr bool test_shrink_to_fit()"), ((const > char*)"v.capacity() == 0"))' is not a constant expression > [...]/libstdc++-v3/testsuite/util/testsuite_hooks.h:66: note: in > expansion of macro '_VERIFY_PRINT' > > [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/constexpr.cc:92: > note: in expansion of macro 'VERIFY' > compiler exited with status 1 > > ..., and: > > PASS: 23_containers/vector/capacity/shrink_to_fit.cc (test for excess > errors) > [-PASS:-]{+FAIL:+} 23_containers/vector/capacity/shrink_to_fit.cc > execution test > > > [...]/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit.cc:33: > void test01(): Assertion 'v.size() == v.capacity()' failed. > > ..., and: > > PASS: 27_io/basic_ostream/inserters_arithmetic/pod/23875.cc (test for > excess errors) > [-PASS:-]{+FAIL:+} > 27_io/basic_ostream/inserters_arithmetic/pod/23875.cc execution test > > terminate called after throwing an instance of 'std::bad_cast' > what(): std::bad_cast > > ..., and: > > [-PASS:-]{+FAIL:+} ext/bitmap_allocator/check_allocate_max_size.cc > (test for excess errors) > [-PASS:-]{+UNRESOLVED:+} > ext/bitmap_allocator/check_allocate_max_size.cc [-execution > test-]{+compilation failed to produce executable+} > > > [...]/libstdc++-v3/testsuite/ext/bitmap_allocator/check_allocate_max_size.cc: > In function 'int main()': > > [...]/libstdc++-v3/testsuite/ext/bitmap_allocator/check_allocate_max_size.cc:29: > error: 'check_allocate_max_size' is not a member of '__gnu_test' > > [...]/libstdc++-v3/testsuite/ext/bitmap_allocator/check_allocate_max_size.cc:29: > error: expected primary-expression before '>' token > > [...]/libstdc++-v3/testsuite/ext/bitmap_allocator/check_allocate_max_size.cc:29: > error: expected primary-expression before ')' token > > ..., and similarly: > > [-PASS:-]{+FAIL:+} ext/malloc_allocator/check_allocate_max_size.cc > (test for excess errors) > [-PASS:-]{+UNRESOLVED:+} > ext/malloc_allocator/check_allocate_max_size.cc [-execution > test-]{+compilation failed to produce executable+} > > [-PASS:-]{+FAIL:+} ext/mt_allocator/check_allocate_max_size.cc (test > for excess errors) > [-PASS:-]{+UNRESOLVED:+} ext/mt_allocator/check_allocate_max_size.cc > [-execution test-]{+compilation failed to produce executable+} > > [-PASS:-]{+FAIL:+} ext/new_allocator/check_allocate_max_size.cc (test > for excess errors) > [-PASS:-]{+UNRESOLVED:+} ext/new_allocator/check_allocate_max_size.cc > [-execution test-]{+compilation failed to produce executable+} > > [-PASS:-]{+FAIL:+} ext/pool_allocator/check_allocate_max_size.cc (test > for excess errors) > [-PASS:-]{+UNRESOLVED:+} ext/pool_allocator/check_allocate_max_size.cc > [-execution test-]{+compilation failed to produce executable+} > > [-PASS:-]{+FAIL:+} ext/throw_allocator/check_allocate_max_size.cc > (test for excess errors) > [-PASS:-]{+UNRESOLVED:+} > ext/throw_allocator/check_allocate_max_size.cc [-execution > test-]{+compilation failed to produce executable+} > > That's all! :-) > > Given my limited C++ language and libstdc++ implementation skills, it's > probably more effective if you address these? But I'll of course give it > a try if you'd like me to. > Yes, I'll fix those, thanks for the heads up. --000000000000eca8d405fd88c35f--