From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61098 invoked by alias); 24 Nov 2015 00:16:05 -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 61056 invoked by uid 89); 24 Nov 2015 00:16:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 24 Nov 2015 00:16:04 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id tAO0Fs20009341; Mon, 23 Nov 2015 18:15:55 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id tAO0Fsxr009339; Mon, 23 Nov 2015 18:15:54 -0600 Date: Tue, 24 Nov 2015 00:40:00 -0000 From: Segher Boessenkool To: Kyrill Tkachov Cc: GCC Patches Subject: Re: [PATCH][combine] PR rtl-optimization/68381: Only restrict pure simplification in mult-extend subst case, allow other substitutions Message-ID: <20151124001553.GA9049@gate.crashing.org> References: <564DA3D1.10905@arm.com> <20151119105739.GA32343@gate.crashing.org> <564DD0ED.9010604@arm.com> <20151119144102.GB32343@gate.crashing.org> <564DE415.1090600@arm.com> <564DE8B6.9040902@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564DE8B6.9040902@arm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02813.txt.bz2 On Thu, Nov 19, 2015 at 03:20:22PM +0000, Kyrill Tkachov wrote: > Hmmm, so the answer to that is a bit further down the validate_replacement: > path. > It's the code after the big comment: > /* See if this is a PARALLEL of two SETs where one SET's destination is > a register that is unused and this isn't marked as an instruction that > might trap in an EH region. In that case, we just need the other SET. > We prefer this over the PARALLEL. > > This can occur when simplifying a divmod insn. We *must* test for this > case here because the code below that splits two independent SETs > doesn't > handle this case correctly when it updates the register status. > > It's pointless doing this if we originally had two sets, one from > i3, and one from i2. Combining then splitting the parallel results > in the original i2 again plus an invalid insn (which we delete). > The net effect is only to move instructions around, which makes > debug info less accurate. */ > > The code extracts all the valid sets inside the PARALLEL and calls > recog_for_combine on them > individually, ignoring the clobber. Before I made this use is_parallel_of_n_reg_sets the code used to test if it is a parallel of two sets, and no clobbers allowed. So it would never allow a clobber of zero. But now it does. I'll fix this in is_parallel_of_n_reg_sets. Thanks for finding the problem! Segher