From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 6873C3955408 for ; Wed, 2 Jun 2021 08:11:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6873C3955408 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 679E4101E; Wed, 2 Jun 2021 01:11:18 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B6A53F73D; Wed, 2 Jun 2021 01:11:17 -0700 (PDT) From: Richard Sandiford To: Kewen Lin Mail-Followup-To: Kewen Lin , gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com, segher@kernel.crashing.org, jeffreyalaw@gmail.com, jakub@redhat.com, richard.guenther@gmail.com, richard.sandiford@arm.com Cc: gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com, segher@kernel.crashing.org, jeffreyalaw@gmail.com, jakub@redhat.com, richard.guenther@gmail.com Subject: Re: [RFC/PATCH 00/11] Fix up some unexpected empty split conditions References: Date: Wed, 02 Jun 2021 09:11:16 +0100 In-Reply-To: (Kewen Lin's message of "Wed, 2 Jun 2021 00:04:50 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 08:11:29 -0000 Kewen Lin writes: > Hi all, > > define_insn_and_split should avoid to use empty split condition > if the condition for define_insn isn't empty, otherwise it can > sometimes result in unexpected consequence, since the split > will always be done even if the insn condition doesn't hold. > > To avoid forgetting to add "&& 1" onto split condition, as > Segher suggested in thread[1], this series is to add the check > and raise an error if it catches the unexpected cases. With > this new check, we have to fix up some existing > define_insn_and_split which are detected as error. I hope all > these places are not intentional to be kept as blank. I wonder whether we should instead redefine the semantics of define_insn_and_split so that the split condition is always applied on top of the insn condition. It's rare for a define_insn_and_split to have independent insn and split conditions, so at the moment, we're making the common case hard. Thanks, Richard > Any comments are highly appreciated. > > BR, > Kewen > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566970.html > > Kewen Lin (11): > gen: Emit error msg for empty split condition > arc: Update unexpected empty split condition > arm: Update unexpected empty split condition > cris: Update unexpected empty split condition > h8300: Update unexpected empty split condition > i386: Update unexpected empty split condition > m68k: Update unexpected empty split condition > mips: Update unexpected empty split condition > or1k: Update unexpected empty split condition > sh: Update unexpected empty split condition > sparc: Update unexpected empty split condition > > gcc/config/arc/arc.md | 2 +- > gcc/config/arm/vfp.md | 4 ++-- > gcc/config/cris/cris.md | 2 +- > gcc/config/h8300/combiner.md | 2 +- > gcc/config/i386/i386.md | 6 +++--- > gcc/config/i386/sse.md | 8 ++++---- > gcc/config/m68k/m68k.md | 6 +++--- > gcc/config/mips/mips.md | 6 +++--- > gcc/config/or1k/or1k.md | 2 +- > gcc/config/sh/sh.md | 2 +- > gcc/config/sparc/sparc.md | 12 ++++++------ > gcc/gensupport.c | 3 +++ > 12 files changed, 29 insertions(+), 26 deletions(-)