From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90444 invoked by alias); 10 Sep 2015 16:31:04 -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 90348 invoked by uid 89); 10 Sep 2015 16:31:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-qg0-f45.google.com Received: from mail-qg0-f45.google.com (HELO mail-qg0-f45.google.com) (209.85.192.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 10 Sep 2015 16:31:02 +0000 Received: by qgez77 with SMTP id z77so40115735qge.1; Thu, 10 Sep 2015 09:31:00 -0700 (PDT) X-Received: by 10.140.233.7 with SMTP id e7mr58130546qhc.79.1441902660037; Thu, 10 Sep 2015 09:31:00 -0700 (PDT) Received: from [192.168.0.26] (97-122-175-227.hlrn.qwest.net. [97.122.175.227]) by smtp.gmail.com with ESMTPSA id z128sm6213931qhd.43.2015.09.10.09.30.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 09:30:59 -0700 (PDT) Message-ID: <55F1B041.5060507@gmail.com> Date: Thu, 10 Sep 2015 16:38:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Florian Weimer , Jonathan Wakely CC: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org, =?windows-1252?Q?Fran?= =?windows-1252?Q?=E7ois_Dumont?= Subject: Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS. References: <20150907182755.GP2631@redhat.com> <87r3mauiud.fsf@mid.deneb.enyo.de> <20150907195939.GT2631@redhat.com> <55EEF828.4060707@redhat.com> <20150908154535.GX2631@redhat.com> <55F05728.1000209@redhat.com> In-Reply-To: <55F05728.1000209@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00701.txt.bz2 On 09/09/2015 09:58 AM, Florian Weimer wrote: > On 09/08/2015 05:45 PM, Jonathan Wakely wrote: > >>> I doubt we can achieve the complexity goals in all cases. I expect that >>> >>> for (int i = 0; i < 10000; ++i) { >>> vector[i]; >>> } >>> >>> is optimized away in default mode, but with _GLIBCXX_ASSERTIONS, it is >>> not. >>> >>> The last time I looked at this, GCC was unable to move bounds checks out >>> of loops. >> >> Maybe we don't want to make _FORTIFY_SOURCE imply _GLIBCXX_ASSERTIONS >> then, so they can be enabled independently. We don't have to make that >> decision right away. > > I think we should try with _FORTIFY_SOURCE first. The above case looks > rather artificial. If there is a visible performance impact, maybe we > can get the compiler to eliminate the vector bounds checks in many cases. There is quite a bit of documentation of _FORTIFY_SOURCE that explains its effect on user code. People who have read the documentation and used the macro to achieve the effect might find the secondary effects on libstdc++ surprising and unwelcome. Martin