From patchwork Wed Aug 1 19:53:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 952363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-482965-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wru655vG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41gkWt73fyz9s3Z for ; Thu, 2 Aug 2018 05:53:46 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=er4cMyxlmP6hYculXzHJjyAlBuNq7kt8o6hHwVLltghM5jsAHUbGn AkoEuW8pnYGRiaBeSJmiw43PN8Agto8SPxa5dJl3SPtrBDlfXALVmcUD5RHHk2wo 8ELq8D5M1XlXUKR8e2OPpvw9ZAZUHPzOCup5GZEUiefKCJgOUUMi84= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=2lHHqH8i+i1QEW/eTV2bBkX37rg=; b=wru655vGyN5Jm4GXh7R8 mB6U6MY1NYUgtUpxdOHUkAshsof3YTuDfXJjPgh9vyX3/I2ZyUKPyrXePGB1kgrq fHDCSpVVynrm2PJjhkkDhbJzM106ohRivtnAE2wBE7aW5ZfI9CzNSnS4xGTn2Exw 3Ou1GydN2ns0QsiIM31sijs= Received: (qmail 28805 invoked by alias); 1 Aug 2018 19:53:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 28768 invoked by uid 89); 1 Aug 2018 19:53:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Aug 2018 19:53:26 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F79440216E6; Wed, 1 Aug 2018 19:53:25 +0000 (UTC) Received: from localhost (unknown [10.33.36.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11D9C2026D68; Wed, 1 Aug 2018 19:53:24 +0000 (UTC) Date: Wed, 1 Aug 2018 20:53:24 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Add -D_GLIBCXX_ASSERTIONS to DEBUG_FLAGS Message-ID: <20180801195324.GA25780@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.2 (2017-12-15) Enable assertions in the extra debug library built when --enable-libstdcxx-debug is used. Replace some Debug Mode assertions in src/c++11/futex.cc with __glibcxx_assert, because the library will never be built with Debug Mode. * configure: Regenerate. * configure.ac: Add -D_GLIBCXX_ASSERTIONS to default DEBUG_FLAGS. * src/c++11/futex.cc: Use __glibcxx_assert instead of _GLIBCXX_DEBUG_ASSERT. Tested powerpc64le-linux, committed to trunk. commit 1af9b89d2b7c7feefae208ad4ebbb4cafe9f3ce4 Author: Jonathan Wakely Date: Wed Aug 1 18:28:06 2018 +0100 Add -D_GLIBCXX_ASSERTIONS to DEBUG_FLAGS Enable assertions in the extra debug library built when --enable-libstdcxx-debug is used. Replace some Debug Mode assertions in src/c++11/futex.cc with __glibcxx_assert, because the library will never be built with Debug Mode. * configure: Regenerate. * configure.ac: Add -D_GLIBCXX_ASSERTIONS to default DEBUG_FLAGS. * src/c++11/futex.cc: Use __glibcxx_assert instead of _GLIBCXX_DEBUG_ASSERT. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 1e0a33fb3ea..332af3706d3 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -168,7 +168,7 @@ GLIBCXX_ENABLE_LONG_LONG([yes]) GLIBCXX_ENABLE_WCHAR_T([yes]) GLIBCXX_ENABLE_C99([yes]) GLIBCXX_ENABLE_CONCEPT_CHECKS([no]) -GLIBCXX_ENABLE_DEBUG_FLAGS(["-gdwarf-4 -g3 -O0"]) +GLIBCXX_ENABLE_DEBUG_FLAGS(["-gdwarf-4 -g3 -O0 -D_GLIBCXX_ASSERTIONS"]) GLIBCXX_ENABLE_DEBUG([no]) GLIBCXX_ENABLE_PARALLEL([yes]) GLIBCXX_ENABLE_CXX_FLAGS diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc index 278a5a80902..a5a8ec68c53 100644 --- a/libstdc++-v3/src/c++11/futex.cc +++ b/libstdc++-v3/src/c++11/futex.cc @@ -53,7 +53,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // here on errors is abort. int ret __attribute__((unused)); ret = syscall (SYS_futex, __addr, futex_wait_op, __val, nullptr); - _GLIBCXX_DEBUG_ASSERT(ret == 0 || errno == EINTR || errno == EAGAIN); + __glibcxx_assert(ret == 0 || errno == EINTR || errno == EAGAIN); return true; } else @@ -75,8 +75,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (syscall (SYS_futex, __addr, futex_wait_op, __val, &rt) == -1) { - _GLIBCXX_DEBUG_ASSERT(errno == EINTR || errno == EAGAIN - || errno == ETIMEDOUT); + __glibcxx_assert(errno == EINTR || errno == EAGAIN + || errno == ETIMEDOUT); if (errno == ETIMEDOUT) return false; }