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 BAE76386F01D for ; Mon, 10 Aug 2020 16:16:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BAE76386F01D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=richard.sandiford@arm.com 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 6CA681063; Mon, 10 Aug 2020 09:16:17 -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 D0B743F6CF; Mon, 10 Aug 2020 09:16:16 -0700 (PDT) From: Richard Sandiford To: Senthil Kumar via Gcc-patches Mail-Followup-To: Senthil Kumar via Gcc-patches , Senthil Kumar , ebotcazou@adacore.com, richard.sandiford@arm.com Cc: Senthil Kumar , ebotcazou@adacore.com Subject: Re: [PATCH] emit-rtl.c: Allow splitting of RTX_FRAME_RELATED_P insns? References: Date: Mon, 10 Aug 2020 17:16:15 +0100 In-Reply-To: (Senthil Kumar via Gcc-patches's message of "Fri, 7 Aug 2020 14:30:26 +0530") 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=-7.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Mon, 10 Aug 2020 16:16:19 -0000 Senthil Kumar via Gcc-patches writes: > Hi, > > I'm working on converting the AVR backend to MODE_CC, following > the steps described for case #2 in the CC0 transition wiki page, > and I've implemented the first three bullet > points (https://github.com/saaadhu/gcc-avr-cc0/tree/avr-cc0-squashed). With > the below patch, there are zero regressions (for mega and xmega > subarchs) compared to the current mainline, as of yesterday. > > The wiki suggests using post-reload splitters, so that's the > direction I took, but I ran into an issue where split_insn > bails out early if RTX_FRAME_RELATED_P is true - this means > that splits for REG_CC clobbering insns with > RTX_FRAME_RELATED_P will never execute, resulting in a > could-not-split insn ICE in the final stage. > > I see that the recog.c:peep2_attempt allows splitting of a > RTX_FRAME_RELATED_P insn, provided the result of the split is a > single insn. Would it be ok to modify try_split also to > allow those kinds of insns (tentative patch attached, code > copied over from peep2_attempt, only setting old and new_insn)? Or is there > a different approach to fix this? I agree there's no obvious reason why splitting to a single insn should be rejected but a peephole2 to a single instruction should be OK. And reusing the existing, tried-and-tested code is the way to go. But could you split the code out of peep2_attempt into a subroutine (probably still in recog.c) and reuse it in try_split? BTW, just to check: is your email address in MAINTAINERS still correct? Thanks, Richard