From patchwork Tue Oct 6 12:53:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 526732 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 ECC73140D68 for ; Tue, 6 Oct 2015 23:53:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=c3L5zxne; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=MypUka648v+5kVp5OT RvoBg4ByLj5UP7QcAGECYDc52TfB9fqQuQdeH/KpcUo2VG9zFh5XUaVX/rIelMYB PpUfrDlmd10w/NvWOniHMhZJF4lPa/FDXb4Oupo7Dmgp1smyuyzoCnnJqLPqNgq/ pgdz//moyrNeDw5H2Ql2xw4Xg= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=GUUwSwX9nSN7I2bGaSX98Dmu WnU=; b=c3L5zxneBHgpgEqmX3QCXTyWviufkQhZNYR2aVR+1AWJC6pCfyxUNFY8 4PAMdwIlfClYrw6dv+dq6f9N/eEBmSuHgf2pXXa+tjkjlWu00Ga7Zj70A+kmMyr2 tcOhOY5TFsPnuMhybDl2ProQnDRS04/qe3vZwcgCL0Fd0hXaHHk= Received: (qmail 104423 invoked by alias); 6 Oct 2015 12:53:15 -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 104409 invoked by uid 89); 6 Oct 2015 12:53:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f179.google.com Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com) (209.85.212.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 06 Oct 2015 12:53:04 +0000 Received: by wicgb1 with SMTP id gb1so164006020wic.1 for ; Tue, 06 Oct 2015 05:53:01 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.187.180 with SMTP id ft20mr17716984wic.78.1444135981037; Tue, 06 Oct 2015 05:53:01 -0700 (PDT) Received: by 10.28.37.130 with HTTP; Tue, 6 Oct 2015 05:53:00 -0700 (PDT) In-Reply-To: <56130763.4070206@gmail.com> References: <56130763.4070206@gmail.com> Date: Tue, 6 Oct 2015 14:53:00 +0200 Message-ID: Subject: Re: [PATCH 1/9] ENABLE_CHECKING refactoring From: Richard Biener To: Mikhail Maltsev Cc: gcc-patches mailing list , Jeff Law X-IsSubscribed: yes On Tue, Oct 6, 2015 at 1:27 AM, Mikhail Maltsev wrote: > Hi! > > This is an updated series of patches which converts 'ENABLE_CHECKING' macro into > a flag, 'flag_checking' (and 'CHECKING_P' macro in several cases). For now > flag_checking is always initialized with the value of 'CHECKING_P', but later it > can be turned into a proper command-line flag and probably split into several > checks. I also added several function which verify internal data structures when > flag_checking is enabled (e.g. checking_verify_flow_info which calls > verify_flow_info). These functions make their callers look somewhat cleaner. > > The cases where I left 'CHECKING_P' are: > 1. libcpp (turn ICE after an error into fatal error) and pretty-printers (that > would require to pass flag_checking to libcpp just for this single case). > 2. Code which fills memory in the pools with some predefined patterns in > deallocation methods (this would add some overhead to each deallocation), though > I have not measured performance impact yet. > 3. Generators and generated code. > 4. Target-specific code > 5. 'struct lra_reg' which has an additional field in checking build > 6. Likewise, 'struct moveop_static_params' in insn scheduler and > 'cumulative_args_t' in target.h. > 7. macro-related code in libcpp (for the same reason) > 8. real.c and fwprop.c - I'll profile these and also fix to use flag_checking if > there won't be any measurable overhead. > > There are 9 patches: > 1. Add flag_checking and CHECKING_P macros > 2. Use CHECKING_P in libcpp > 3. Ada and Java frontends > 4. Fortran frontend > 5. Pool allocators > 6. Generator programs > 7. Most of middle-end (GIMPLE, IPA, RTL) - it can be split further, if needed. > 8. Target-specific code > 9. C++ frontend - in progress (I will send this part soon). > > Some issues related to checking builds: > 1. Useless check in graphite: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67842 > 2. I found a test which fails only on release builds: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58583 (reopened) > 3. Another one: gcc.c-torture/compile/pr52073.c which is, I guess, caused by > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67816 (the backtrace is the same, > at least). > > Each patch (when applied on top of all the previous ones) compiles in both > checking and release builds. The combined patch passes bootstrap and regression > tests in checking an release builds (apart from 2 issues mentioned above) on > x86_64-linux. I'll also run it through config-list.mk. This looks ok to me, though I'd have defined CHECKING_P from configure.ac where we define ENABLE_CHECKING. should do that? Richard. > -- > Regards, > Mikhail Maltsev > > > gcc/ChangeLog: > > 2015-10-05 Mikhail Maltsev > > * common.opt: Add flag_checking. > * system.h (CHECKING_P): Define. > > libcpp/ChangeLog: > > 2015-10-05 Mikhail Maltsev > > * system.h (CHECKING_P, gcc_checking_assert): Define. Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 228519) +++ gcc/configure.ac (working copy) @@ -569,7 +569,10 @@ if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks.]) + AC_DEFINE(CHECKING_P, 1) nocommon_flag=-fno-common +else + AC_DEFINE(CHECKING_P, 0) fi AC_SUBST(nocommon_flag) if test x$ac_df_checking != x ; then