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 [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 2620F3857C65 for ; Mon, 9 Nov 2020 12:58:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2620F3857C65 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-26-lTfDI1xmOX-Zgd78Z4uM5w-1; Mon, 09 Nov 2020 07:58:03 -0500 X-MC-Unique: lTfDI1xmOX-Zgd78Z4uM5w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 479C4186840E; Mon, 9 Nov 2020 12:58:02 +0000 (UTC) Received: from localhost (unknown [10.33.36.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id D91E06198E; Mon, 9 Nov 2020 12:58:01 +0000 (UTC) Date: Mon, 9 Nov 2020 12:58:01 +0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: [PATCH] 1/2 Make _GLIBCXX_DEBUG checks constexpr compatible Message-ID: <20201109125801.GN503596@redhat.com> References: <60e247d6-f0b5-7613-34ea-2810e84d9ca1@gmail.com> MIME-Version: 1.0 In-Reply-To: <60e247d6-f0b5-7613-34ea-2810e84d9ca1@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2020 12:58:06 -0000 On 08/11/20 15:06 +0100, François Dumont via Libstdc++ wrote: >Now that __glibcxx_assert is constexpr compatible we can do the same >for the _GLIBCXX_DEBUG equivalent. > >I had also try to do the same on my own so this patch contains the >string_view tests I had written when doing so. > >I plan to activate some _GLIBCXX_DEBUG checks when _GLIBCXX_ASSERTIONS >is defined but only the contant time checks. Is it ok to run checks >like __check_partitioned_lower in constexpr ? Hmm, I don't *think* it's possible to detect the additional calls to the comparison function during constant evaluation. So I think the only concern is the extra work the compiler has to do, i.e. the extra time it takes to compile. The constant-time checks should be OK though. >    libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible [snip] >Ok to commit ? Yes, thanks.