From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27781 invoked by alias); 23 Oct 2019 15:26:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 27772 invoked by uid 89); 23 Oct 2019 15:26:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=qualify X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Oct 2019 15:26:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571844365; 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=+24Y283uLHJ6BmbQmbNO52a0RhQ9PXkBkWeSVgXwgek=; b=X3VZp45jKDQiayqQnRCwAyU/zV3Vv3DW6m5pSEgCT+aq2J8yk8T9fKeJePjwDh5tVu+ZgW npPTi6kK16pzTZulvg0GQQQ11P97U3fn7pYXkfe7LApW+JLb68fUaCWpcfEiXNETxVHL6L Ev6yol6NCw8X+orp0scL7bw81CpAL9A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-PRKFLh-UPYWcRzfSXJxwyg-1; Wed, 23 Oct 2019 11:26:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1DDD21800D6B; Wed, 23 Oct 2019 15:26:02 +0000 (UTC) Received: from localhost (unknown [10.33.36.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id A84956055B; Wed, 23 Oct 2019 15:26:01 +0000 (UTC) Date: Wed, 23 Oct 2019 16:02:00 -0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: [PATCH] Fix algo constexpr tests in Debug mode Message-ID: <20191023152600.GP4169@redhat.com> References: <368143e7-e151-9e37-f055-065044a57e7a@gmail.com> <20190927121109.GY9487@redhat.com> <20190927164507.GF9487@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.1 (2019-06-15) X-Mimecast-Spam-Score: 0 Content-Type: multipart/mixed; boundary="tmoQ0UElFV5VgXgH" Content-Disposition: inline X-SW-Source: 2019-10/txt/msg01668.txt.bz2 --tmoQ0UElFV5VgXgH Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2110 On 28/09/19 23:12 +0200, Fran=E7ois Dumont wrote: >Here is what I just commited. > >I try to use the asm trick in the _GLIBCXX_DEBUG_VERIFY_COND_AT but=20 >didn't notice any enhancement. So for now I kept my solution to just=20 >have a non-constexpr call compiler error. > >I fix my patch to use __builtin_is_constant_evaluated rather than=20 >std::is_constant_evaluated in __valid_range. > >=A0=A0=A0 * include/bits/stl_algobase.h (__memmove): Return _Tp*. >=A0=A0=A0 (__memmove): Loop as long as __n is not 0. >=A0=A0=A0 (__copy_move<>::__copy_m): Likewise. >=A0=A0=A0 (__copy_move_backward<>::__copy_move_b): Likewise. >=A0=A0=A0 * testsuite/25_algorithms/copy/constexpr.cc: Add check on copied= =20 >values. >=A0=A0=A0 * testsuite/25_algorithms/copy_backward/constexpr.cc: Likewise. >=A0=A0=A0 * testsuite/25_algorithms/copy/constexpr_neg.cc: New. >=A0=A0=A0 * testsuite/25_algorithms/copy_backward/constexpr.cc: New. > >=A0=A0=A0 * include/debug/forward_list >(_Sequence_traits<__debug::forward_list<>>::_S_size): Returns __dp_sign >=A0=A0=A0 distance when not empty. >=A0=A0=A0 * include/debug/list >=A0=A0=A0 (_Sequence_traits<__debug::list<>>::_S_size): Likewise. >=A0=A0=A0 * include/debug/helper_functions.h (__dp_sign_max_size): New >=A0=A0=A0 _Distance_precision enum entry. >=A0=A0=A0 * include/debug/safe_iterator.h >=A0=A0=A0 (__copy_move_a(_II, _II, const _Safe_iterator<>&)): Check for ou= tput >=A0=A0=A0 iterator _M_can_advance as soon as input range distance precisio= n is >=A0=A0=A0 strictly higher than __dp_size. >=A0=A0=A0 (__copy_move_a(const _Safe_iterator<>&, const _Safe_iterator<>&, >=A0=A0=A0 const _Safe_iterator<>&)): Likewise. >=A0=A0=A0 (__copy_move_backward_a(_II, _II, const _Safe_iterator<>&)): Lik= ewise. >=A0=A0=A0 (__copy_move_backward_a(const _Safe_iterator<>&, >=A0=A0=A0 const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. >=A0=A0=A0 (__equal_aux(_II, _II, const _Safe_iterator<>&)): Likewise. >=A0=A0=A0 (__equal_aux(const _Safe_iterator<>&, >=A0=A0=A0 const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise. I'm going to commit this small fix. --tmoQ0UElFV5VgXgH Content-Type: text/x-patch; charset=WINDOWS-1252 Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: quoted-printable Content-length: 957 commit d78a141b86aca5a1265ec2df96428ef387492a1f Author: Jonathan Wakely Date: Wed Oct 23 16:19:28 2019 +0100 Only qualify function as constexpr for C++14 and later =20=20=20=20 This helper function is not a valid constexpr function in C++11, so should only be marked constexpr for C++14 and later. =20=20=20=20 * include/debug/helper_functions.h (__valid_range): Change _GLIBCXX_CONSTEXPR to _GLIBCXX14_CONSTEXPR. diff --git a/libstdc++-v3/include/debug/helper_functions.h b/libstdc++-v3/i= nclude/debug/helper_functions.h index 5a920bb9a6f..c3e7478f649 100644 --- a/libstdc++-v3/include/debug/helper_functions.h +++ b/libstdc++-v3/include/debug/helper_functions.h @@ -221,7 +221,7 @@ namespace __gnu_debug #endif =20 template - _GLIBCXX_CONSTEXPR + _GLIBCXX14_CONSTEXPR inline bool __valid_range(_InputIterator __first, _InputIterator __last) { --tmoQ0UElFV5VgXgH--