From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8480 invoked by alias); 16 Jan 2014 22:41:55 -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 8463 invoked by uid 89); 16 Jan 2014 22:41:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 16 Jan 2014 22:41:52 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id A59F554302F; Thu, 16 Jan 2014 23:41:48 +0100 (CET) Date: Thu, 16 Jan 2014 22:41:00 -0000 From: Jan Hubicka To: Teresa Johnson Cc: Jan Hubicka , "gcc-patches@gcc.gnu.org" , David Li Subject: Re: [Patch] Avoid gcc_assert in libgcov Message-ID: <20140116224148.GG22909@kam.mff.cuni.cz> References: <20140109145623.GB19409@kam.mff.cuni.cz> <20140116043923.GA22909@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-01/txt/msg01047.txt.bz2 > On Wed, Jan 15, 2014 at 8:39 PM, Jan Hubicka wrote: > >> > >> In that case should we call gcov_error when IN_LIBGCOV? One > >> possibility would be to simply make gcov_nonruntime_assert be defined > >> as if (!EXPR) gcov_error in the IN_LIBGCOV case. But I think what you > >> wanted here was to reduce libgcov bloat by removing calls altogether, > >> which this wouldn't solve. But if we want to call gcov_error in some > >> cases, I think I need to add another macro that will either do > >> gcc_assert when !IN_LIBGCOV and "if (!EXPR) gcov_error" when > >> IN_LIBGCOV. Is that what you had in mind? > > > > I think for errors that can be triggered by data corruption, we ought to > > produce resonable error messages in both IN_LIBGCOV or for offline tools. > > Just unwound sequence if(...) gcov_error seems fine to me in this case, > > but we may also have assert like wrapper. > > I see we do not provide gcov_error outside libgcov, we probably ought to map > > it to fatal_error in GCC binary. > > > > thanks, > > Honza > > Ok, here is the new patch. Bootstrapped and tested on > x86_64-unknown-linux-gnu. Ok for trunk? > > Thanks, Teresa > > 2014-01-16 Teresa Johnson > > * gcov-io.c (gcov_position): Use gcov_nonruntime_assert. > (gcov_is_error): Remove gcc_assert from IN_LIBGCOV code. > (gcov_rewrite): Use gcov_nonruntime_assert. > (gcov_open): Ditto. > (gcov_write_words): Ditto. > (gcov_write_length): Ditto. > (gcov_read_words): Use gcov_nonruntime_assert, and remove > gcc_assert from IN_LIBGCOV code. > (gcov_read_summary): Use gcov_error to flag profile corruption. > (gcov_sync): Use gcov_nonruntime_assert. > (gcov_seek): Remove gcc_assert from IN_LIBGCOV code. > (gcov_histo_index): Use gcov_nonruntime_assert. > (static void gcov_histogram_merge): Ditto. > (compute_working_sets): Ditto. > * gcov-io.h (gcov_nonruntime_assert): Define. > (gcov_error): Define for !IN_LIBGCOV OK, thanks! Honza