From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80965 invoked by alias); 30 Jun 2015 05:26:29 -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 80952 invoked by uid 89); 30 Jun 2015 05:26:29 -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,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Jun 2015 05:26:28 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1Z9o3r-0006bh-8h from ChungLin_Tang@mentor.com ; Mon, 29 Jun 2015 22:26:23 -0700 Received: from [0.0.0.0] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Mon, 29 Jun 2015 22:26:22 -0700 Message-ID: <5592287F.4050203@codesourcery.com> Date: Tue, 30 Jun 2015 06:11:00 -0000 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Sandra Loosemore , Kito Cheng CC: Jeff Law , Eric Botcazou , "gcc-patches@gcc.gnu.org" , Marcus Shawcroft , Richard Earnshaw , "Schmidt, Bernd - Code Sourcery" Subject: Re: [patch] fix regrename pass to ensure renamings produce valid insns References: <5581AA41.7010201@codesourcery.com> <1919634.FPIRa5rfyH@polaris> <558A0130.9010202@codesourcery.com> <558B7998.80201@redhat.com> <5590624E.8090409@codesourcery.com> <55921988.8060106@codesourcery.com> <55922571.2050808@codesourcery.com> In-Reply-To: <55922571.2050808@codesourcery.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg02144.txt.bz2 On 2015/6/30 下午 01:13, Chung-Lin Tang wrote: > On 2015/6/30 12:22 PM, Sandra Loosemore wrote: >> On 06/29/2015 09:07 PM, Kito Cheng wrote: >>> Hi all: >>> >>> This patch seem will broken when disable assert checking for c6x.... >>> >>> Index: gcc/config/c6x/c6x.c >>> =================================================================== >>> --- gcc/config/c6x/c6x.c (revision 225104) >>> +++ gcc/config/c6x/c6x.c (working copy) >>> @@ -3516,7 +3516,7 @@ try_rename_operands (rtx_insn *head, rtx >>> best_reg = >>> find_rename_reg (this_head, super_class, &unavailable, old_reg, true); >>> >>> - regrename_do_replace (this_head, best_reg); >>> + gcc_assert (regrename_do_replace (this_head, best_reg)); >>> >>> count_unit_reqs (new_reqs, head, PREV_INSN (tail)); >>> merge_unit_reqs (new_reqs); >>> @@ -3529,7 +3529,7 @@ try_rename_operands (rtx_insn *head, rtx >>> unit_req_imbalance (reqs), unit_req_imbalance (new_reqs)); >>> } >>> if (unit_req_imbalance (new_reqs) > unit_req_imbalance (reqs)) >>> - regrename_do_replace (this_head, old_reg); >>> + gcc_assert (regrename_do_replace (this_head, old_reg)); >>> else >>> memcpy (reqs, new_reqs, sizeof (unit_req_table)); >>> >> >> I'm sorry; do you have a suggestion for a fix? I thought this was the change I was asked to make, and as I noted previously, I'm not set up to test (or even build) for this target. >> >> -Sandra the obviously confused :-( > > You probably have to separate out the regrename_do_replace() bool result into a variable, > placing the whole call into the gcc_assert() might make it disappear when assertions are turned off. I notice the way gcc_assert() is defined in system.h now, the test won't disappear even when runtime checks are disabled, though you might still adjust it to avoid any programmer confusion. Chung-Lin