From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4775 invoked by alias); 5 Oct 2015 23:31:10 -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 4766 invoked by uid 89); 5 Oct 2015 23:31:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f54.google.com Received: from mail-la0-f54.google.com (HELO mail-la0-f54.google.com) (209.85.215.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 05 Oct 2015 23:31:08 +0000 Received: by lafb9 with SMTP id b9so45950016laf.0 for ; Mon, 05 Oct 2015 16:31:04 -0700 (PDT) X-Received: by 10.25.84.195 with SMTP id i186mr8468732lfb.43.1444087864732; Mon, 05 Oct 2015 16:31:04 -0700 (PDT) Received: from [192.168.123.200] ([77.41.78.126]) by smtp.googlemail.com with ESMTPSA id v19sm4734331lfd.7.2015.10.05.16.31.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 16:31:03 -0700 (PDT) Message-ID: <56130837.2020202@gmail.com> Date: Mon, 05 Oct 2015 23:31:00 -0000 From: Mikhail Maltsev User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: gcc-patches mailing list , Jeff Law , Richard Biener Subject: [PATCH 4/9] ENABLE_CHECKING refactoring: Fortran References: <56130763.4070206@gmail.com> In-Reply-To: <56130763.4070206@gmail.com> Content-Type: multipart/mixed; boundary="------------020001060007050905090607" X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00481.txt.bz2 This is a multi-part message in MIME format. --------------020001060007050905090607 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 199 gcc/fortran/ChangeLog: 2015-10-05 Mikhail Maltsev * trans-common.c (create_common): Adjust to use flag_checking. * trans.c (gfc_add_modify_loc): Use gcc_checking_assert. --------------020001060007050905090607 Content-Type: text/x-patch; name="0004-Fortran.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0004-Fortran.patch" Content-length: 2013 >From 8113b4d5bc943772145abdd6562d4af6093d9718 Mon Sep 17 00:00:00 2001 From: Mikhail Maltsev Date: Sat, 3 Oct 2015 10:02:21 +0300 Subject: [PATCH 4/9] Fortran --- gcc/fortran/trans-common.c | 15 +++++++-------- gcc/fortran/trans.c | 6 ++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 7f4bfe5..ae336c1 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -686,14 +686,13 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) TREE_STATIC (ctor) = 1; DECL_INITIAL (decl) = ctor; -#ifdef ENABLE_CHECKING - { - tree field, value; - unsigned HOST_WIDE_INT idx; - FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value) - gcc_assert (TREE_CODE (field) == FIELD_DECL); - } -#endif + if (flag_checking) + { + tree field, value; + unsigned HOST_WIDE_INT idx; + FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value) + gcc_assert (TREE_CODE (field) == FIELD_DECL); + } } /* Build component reference for each variable. */ diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index f30809a..4eaea53 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -151,7 +151,6 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs) { tree tmp; -#ifdef ENABLE_CHECKING tree t1, t2; t1 = TREE_TYPE (rhs); t2 = TREE_TYPE (lhs); @@ -159,9 +158,8 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs) for scalar assignments. We should probably have something similar for aggregates, but right now removing that check just breaks everything. */ - gcc_assert (t1 == t2 - || AGGREGATE_TYPE_P (TREE_TYPE (lhs))); -#endif + gcc_checking_assert (t1 == t2 + || AGGREGATE_TYPE_P (TREE_TYPE (lhs))); tmp = fold_build2_loc (loc, MODIFY_EXPR, void_type_node, lhs, rhs); -- 2.1.4 --------------020001060007050905090607--