From patchwork Thu Jun 13 07:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1947272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OGKSIjor; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W0DWw4j1Bz20fP for ; Thu, 13 Jun 2024 17:27:40 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E7773884503 for ; Thu, 13 Jun 2024 07:27:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 14374388207F for ; Thu, 13 Jun 2024 07:27:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14374388207F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14374388207F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718263637; cv=none; b=GJ3XfUVQMxUAzYqZ/xzTDWzZ27+8kWnlL/VRlyCt76gOiZkhFGdQQfG16tAFFZaAO7TAMNiqrdACs96XGv3gOwH+A7LeulNRjqbzEQad3L0hqGphTDGp2t1a5O4YX89kRkCFL602qW7F8g9pc5BEFS5n5npLBa47ptSNG+woJlg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718263637; c=relaxed/simple; bh=UEE70rPb16UgetZcQURN1yi0rFco+aWlBoF1vOzo/+g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=s3hARuSJ11/stKpf0bUuEva2N61Q2HzxrSk2kNtAyaZH+ZTZrNHtnKXcI44CigqZwado79iLE44z695JZBJLuFQyD4VYzyErNq7G+JX7FhC3RnERu/WBgEv7hFe/w3gFrQDbpz6wD1PP4bbh1udw1OBKjhtVWj7qzB41htdGAzg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1f4a0050b9aso6562975ad.2 for ; Thu, 13 Jun 2024 00:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718263635; x=1718868435; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:date:organization:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=SgoZTl05Opy3Ar3aypon7xyrlxJOsyYNvlUNWDiXCEw=; b=OGKSIjorSzEUwuDF9a8W9K3h7/n9CBO9ALLoold4ChdwGlTSzs/0CXVQy4a+K7gl4d MMBkmIEuvvRi4H3nkAxeblucFJDUO7zB1ePUCsfGK5SLeOcSGcnJbuQufbM2F1DU1Afz QxISM5Qmq1Js0YkaDbb5h2/YNK43hVvnYRLXyU+VgToumF76sVRqBr7sjYYl5u9Dz4w+ XxnHosRDCyRb7/fQs9oNRAX6/t4DP/aga6oiYtnyc54+SoR2uqQxnHNjW1Mt4dKqq3q5 rNPdgGmvuBpllKfwaJZSoFaDM6a5LXDlv666Ke42mUBQ5sb1fu+WNvJROsIeDd6kDZG9 kePg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718263635; x=1718868435; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SgoZTl05Opy3Ar3aypon7xyrlxJOsyYNvlUNWDiXCEw=; b=iKjJkTKm/xIwMsrCTxDlwfN0UI7c8vPM5mNbXFumWvtVuU+Dt9C/j1dyf7yJNRQIC9 4oiYOJ6owhhXER2+Pc52z0TIq/Nba76Zf613WPIAY9WEXysiTkdq5pqtXRnd4fEN8p+Y RFovv0ixcsdzT8xdOLLgIGJ48KYWiDN3JxStYOhXxReR1vlRsYlZ1pp6/eJr122BDsq7 dgXUEvMaWXMODyfnAx38ZoxCYRENDqorDgfbvGPj+6uKN/y+qHjYD8kqi6CJaCiEmjft 8uuUXf5gXwnAZxysgD/giios2Smfue2Af3XnHYwc0RJtllogwoqJhHev4f3lpBVc6ztE yQUg== X-Gm-Message-State: AOJu0YxGo150Zd3LYvgeL9nnsQb6mbHd7ihizWcDIwh1P7FOo59qdv5h eQA2oOXz3FoWDsWfIetuRpKLP8WovvgSZZ6yCwZUqwRWpQHQd2/edNR893oThoojJif4xFVz/Pt fyg== X-Google-Smtp-Source: AGHT+IEeMMiKQrN0W40ij4t/PTRn6P6/Rc0e6dcI06fzhJrrzYkPvuX7SquQ6rWKD343JCMLjpludQ== X-Received: by 2002:a17:902:b683:b0:1f7:1ba3:b93e with SMTP id d9443c01a7336-1f83b569cdfmr36439585ad.21.1718263634877; Thu, 13 Jun 2024 00:27:14 -0700 (PDT) Received: from free.home ([2804:7f1:218b:1961:ef8:d680:5399:8b1a]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855f16888sm6642695ad.226.2024.06.13.00.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 00:27:14 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 45D7R2Zj1173446 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 04:27:02 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [PATCH] [libstdc++] [testsuite] require cmath for [PR114359] Organization: Free thinker, does not speak for AdaCore Date: Thu, 13 Jun 2024 04:27:02 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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? 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()