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 A5B3E3870899 for ; Thu, 13 Jun 2024 10:42:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5B3E3870899 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A5B3E3870899 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718275327; cv=none; b=XlceIrB3CSks+Z95ZeukRfmppa5jS6qpJrhPbx/36W+f5IBQejwhEiGuF/zRXbKrRN49e39lh8tcXDgo18FBT7xLfj+97DMXag3gaWpyRZ/S9gT0NG8ik0sHK/WI7L2g+8gUvb/R2rWCa1HH6t2lSJoSbL5pbrw441rwDSiAPuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718275327; c=relaxed/simple; bh=N4B2e10YbuI8Lo/lr8zjKKOSCuqYuu33+nkVkoo5CS8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=AdmQf6L0EqeRYQe8Pq3DqF3QOrf6nsTqzuBSeksHfuySqSvygWmTa3n08u9hqW0c7XGokn2VkaD1M3JdwYBnJel8jjts4loQqMN08G3wKnZbhQO4gfGFJmcnFrijHHgeqfjs/exIOKnlm5zWatP1Mtul64LxHeKA9IxWeJLdFQ0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718275325; 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=htr6b0M2n7Po+vABphdW8ykSg9peXICFBRQKl5JK6t0=; b=eJUSSiOXMCwB+Isju8FBXIkmU+Kco0qXkqF5VFIMX7ycZvfkPSj4+B25AQDYTfrdznxf4g JjzREESECflNqQLERuPR6HV9OnTzgPLDwq3tyoiCsmcNq+rkXrnIhxdLjoeicf7wSK0qac l70lDJ62H/wWMLCks9YN5vum5knlmVE= Received: from mail-yw1-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-350-81QD-yAIPgubi8TsO6aHlQ-1; Thu, 13 Jun 2024 06:42:04 -0400 X-MC-Unique: 81QD-yAIPgubi8TsO6aHlQ-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-62a08273919so12567957b3.1 for ; Thu, 13 Jun 2024 03:42:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718275323; x=1718880123; 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=htr6b0M2n7Po+vABphdW8ykSg9peXICFBRQKl5JK6t0=; b=WynSURRfH6GbpZ4WKwIGifeGyE/QJxh96kTXTaHD/IHeawmpC+SP0Hj4q8WH0JPrKX bABDDbg35yz7zhDzO0yDrFjWUYoeCqWX94wDvDsKEUfk+ghKZCjFqO0ie0LtzTsFza/d CXYeycZAypU784nO2VWI5KlkoyeQt6iBLixiN2w7FibAyWKWIPVSujuml8eyfAv5tMjg r1WmzE7ojhIoB5c8c0mHt70HPltFlimIWSJ7Wx8lJsQn4lxoUD4TH28WsKsv29zZ+zRU Y8V9z2aLnXZ7idddnyvvniCCwSnH5+PlQzbxEglP0KNs6x25eVU4h3X1wZVxqXik1Szx 6+/g== X-Gm-Message-State: AOJu0Yzvt+9s6FOv+3Dyio+jLbDn6ug6+5+Socvf5utL/1KLocNAOmQ9 ActzysHWf9/1Y9iHEprbDdGVItyXdu8Hu5fgARDvIFvaje5KS8trzSiq+vOX08/bXBKfS80Uo8z x4zBgBqJ4zl62khzV3+42d6LnRPetuCXrpj49TtqDz7/EgD2Hz+3BANSsezyGHh7bcqG8W1Agqb UKo1c+1S4fFaT0JAkGrZLSI0Rca7EvIg== X-Received: by 2002:a25:b125:0:b0:dfa:5748:124c with SMTP id 3f1490d57ef6-dfe6606d5famr4000264276.10.1718275323586; Thu, 13 Jun 2024 03:42:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESjt+55DFu7hjYeMHC/oNWQn3DvC3VeGof0zukIWuG1HpVYfPGQLNN1ThvNgNwzH/CFMnom29zYT0momnismk= X-Received: by 2002:a25:b125:0:b0:dfa:5748:124c with SMTP id 3f1490d57ef6-dfe6606d5famr4000255276.10.1718275323272; Thu, 13 Jun 2024 03:42:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Thu, 13 Jun 2024 11:41:46 +0100 Message-ID: Subject: Re: [PATCH] [libstdc++] [testsuite] require cmath for [PR114359] To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,URI_HEX,WEIRD_QUOTING 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 Thu, 13 Jun 2024 at 08:27, Alexandre Oliva wrote: > > > When !_GLIBCXX_USE_C99_MATH_TR1, binomial_distribution doesn't use the > optimized algorithm that was fixed in response to PR114359. Without > that optimized algorithm, operator() ends up looping very very long > for the test, to the point that it would time out by several orders of > magnitude, without even exercising the optimized algorithm that we're > testing for regressions. Arrange for the test to be skipped if that > bit won't be exercised. > > Regstrapped on x86_64-linux-gnu, also tested with gcc-13 > x-aarch64-rtems6, where the problem was detected. Ok to install? OK. This finding suggests we shouldn't even bother defining binomial_distribution without the functions. It doesn't seem useful if it's that slow (or is that just because this test uses 1<<30 as the t parameter?) Either way, the change to the test is fine. > > > for libstdc++-v3/ChangeLog > > PR libstdc++/114359 > * testsuite/26_numerics/random/binomial_distribution/114359.cc: > Require cmath. > --- > .../random/binomial_distribution/114359.cc | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc > index c1e4c380bf91d..12d967dcbfd34 100644 > --- a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc > +++ b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc > @@ -2,6 +2,19 @@ > > // Bug 114359 - std::binomial_distribution hangs in infinite loop > > +// { dg-require-cmath "" } > + > +// The requirement above is not strictly true. The test should work > +// without cmath, and it probably does, but without cmath, > +// binomial_distribution::operator() skips the optimized algorithm and > +// calls _M_waiting to loop a gazillion times. On aarch64-rtems6 > +// qemu, that loop takes over 5 minutes to go through a small fraction > +// of the iteration space (__x at 22k, limited at 1G; __sum at 2e-5, > +// limited at 0.69). The bug we're regression-testing here was in the > +// cmath-requiring bit, so even if this could conceivably not time out > +// on a really fast machine, there's hardly any reason to exercise > +// this extreme case. > + > #include > > int main() > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive >