From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114203 invoked by alias); 6 Oct 2015 12:59:21 -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 114097 invoked by uid 89); 6 Oct 2015 12:59:21 -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-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 06 Oct 2015 12:59:11 +0000 Received: by wicfx3 with SMTP id fx3so157585283wic.0 for ; Tue, 06 Oct 2015 05:59:08 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.115.199 with SMTP id jq7mr40115911wjb.82.1444136347892; Tue, 06 Oct 2015 05:59:07 -0700 (PDT) Received: by 10.28.37.130 with HTTP; Tue, 6 Oct 2015 05:59:07 -0700 (PDT) In-Reply-To: <5613C2B0.5010206@redhat.com> References: <56130763.4070206@gmail.com> <56130A34.8020005@gmail.com> <5613C2B0.5010206@redhat.com> Date: Tue, 06 Oct 2015 12:59:00 -0000 Message-ID: Subject: Re: [PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE From: Richard Biener To: Bernd Schmidt Cc: Mikhail Maltsev , gcc-patches mailing list , Jeff Law Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00558.txt.bz2 On Tue, Oct 6, 2015 at 2:46 PM, Bernd Schmidt wrote: > On 10/06/2015 01:39 AM, Mikhail Maltsev wrote: >> >> void verify_insn_chain (void); >> +static inline void checking_verify_insn_chain (); >> static void fixup_fallthru_exit_predecessor (void); >> static int can_delete_note_p (const rtx_note *); >> static int can_delete_label_p (const rtx_code_label *); > > [...] >> >> @@ -3990,6 +3987,16 @@ verify_insn_chain (void) >> >> gcc_assert (insn_cnt1 == insn_cnt2); >> } >> + >> +/* Perform checks, if they were requested by corresponding flag. */ >> + >> +static inline void >> +checking_verify_insn_chain () >> +{ >> + if (flag_checking) >> + verify_insn_chain (); >> +} >> + > > > There are many new such small inline functions, and I don't think they buy > us much over just writing out the pattern where they are called. Also, just > defined the function before its first use rather than writing a forward > declaration. > >> diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c >> index 3b8d594..7771514 100644 >> --- a/gcc/tree-ssa-alias.c >> +++ b/gcc/tree-ssa-alias.c >> @@ -1443,11 +1443,8 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, >> bool tbaa_p) >> tbaa_p); >> >> /* We really do not want to end up here, but returning true is safe. >> */ >> -#ifdef ENABLE_CHECKING >> - gcc_unreachable (); >> -#else >> + gcc_checking_assert (false); >> return true; >> -#endif >> } > > > I think the consensus has been to avoid assert (false), so this would be > > if (checking) > gcc_unreachable (); > > but maybe we really just want to do the gcc_unreachable unconditionally. I'm fine with unconditional gcc_unreachable - the code is old enough now that we shouldn't hit this anymore. Richard. > > Bernd