From patchwork Wed Dec 3 16:14:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 417493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 BB6481400E2 for ; Thu, 4 Dec 2014 03:17:37 +1100 (AEDT) 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=CsoZgyoQP7xVOeIVj dAzdHXOt9So60itum98KxjEi58r5N474C2BSdfEg0v2ne8oXbLuH1o8YV+f4NyaT Lvcfg91xqd7D4HhqNR0Px/fkUbBM5fDVI+xI1JxnEx1zzsBW+clnmJ+BYPMBVvzh 6OR0b/xqQ0JPO+Y8bal6E1VvPg= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=zXA9Uw2W34SLEhGCxlOBmWb SJEA=; b=ryt65/O/zT/5HzNbAuhzqYT48rE8m9HGcLYWBga1mFHHKPlNRyG6dPK /CU07m1tNsjpRkcG41GTFaw445F77bc8zTkJyrha4nWtEC7ZskQYb07vxINrWTFY o5ef2PwonGcldziWDXPx1BpI+NrM8GbnOQp2MH7MRDgMQrqW/QNo= Received: (qmail 9281 invoked by alias); 3 Dec 2014 16:14:19 -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 9243 invoked by uid 89); 3 Dec 2014 16:14:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 03 Dec 2014 16:14:18 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB3GEEEs005894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 3 Dec 2014 11:14:15 -0500 Received: from redhat.com (ovpn-116-78.ams2.redhat.com [10.36.116.78]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB3GEARZ004623 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 3 Dec 2014 11:14:13 -0500 Date: Wed, 3 Dec 2014 17:14:10 +0100 From: Marek Polacek To: Jonathan Wakely Cc: GCC Patches , libstdc++@gcc.gnu.org Subject: Re: [PATCH] Fix some 28_regex/ fallout Message-ID: <20141203161410.GB16332@redhat.com> References: <20141203154705.GA16332@redhat.com> <20141203160337.GP3134@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141203160337.GP3134@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) On Wed, Dec 03, 2014 at 04:03:37PM +0000, Jonathan Wakely wrote: > On 03/12/14 16:47 +0100, Marek Polacek wrote: > >@@ -417,7 +417,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > typedef typename std::is_same<_CharT, char>::type _UseCache; > > > > static constexpr size_t > >- _S_cache_size() { return 1ul << (sizeof(_CharT) * __CHAR_BIT__); } > >+ _S_cache_size() { return 1ul << (sizeof(_CharT) * __CHAR_BIT__ > >+ * int(_UseCache::value)); } > > Please re-indent it as: > > static constexpr size_t > _S_cache_size() > { > return 1ul << (sizeof(_CharT) * __CHAR_BIT__ * int(_UseCache::value)); > } > > So the expression is all on one line. OK with that change - thanks! Oops. Applying the following then. 2014-12-03 Marek Polacek * include/bits/regex_compiler.h (_S_cache_size): Multiply the RHS of the shift-expression by _UseCache::value. Marek diff --git gcc/include/bits/regex_compiler.h gcc/include/bits/regex_compiler.h index d8880cc..66a4483 100644 --- gcc/include/bits/regex_compiler.h +++ gcc/include/bits/regex_compiler.h @@ -417,7 +417,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename std::is_same<_CharT, char>::type _UseCache; static constexpr size_t - _S_cache_size() { return 1ul << (sizeof(_CharT) * __CHAR_BIT__); } + _S_cache_size() + { + return 1ul << (sizeof(_CharT) * __CHAR_BIT__ * int(_UseCache::value)); + } struct _Dummy { }; typedef typename std::conditional<_UseCache::value,