From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53459 invoked by alias); 15 Nov 2016 13:13:34 -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 53442 invoked by uid 89); 15 Nov 2016 13:13:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:8.13.8 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 ESMTP; Tue, 15 Nov 2016 13:13:32 +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 uAFDDO0C020702; Tue, 15 Nov 2016 07:13:24 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id uAFDDN0J020701; Tue, 15 Nov 2016 07:13:23 -0600 Date: Tue, 15 Nov 2016 13:13:00 -0000 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Re: An alternative fix for PR70944 Message-ID: <20161115131322.GF12325@gate.crashing.org> References: <87d1hw53el.fsf@e105548-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d1hw53el.fsf@e105548-lin.cambridge.arm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg01435.txt.bz2 On Tue, Nov 15, 2016 at 12:33:06PM +0000, Richard Sandiford wrote: > The transformations made by make_compound_operation apply > only to scalar integer modes. The fix for PR70944 had enforced > that by returning early for vector modes at the top of the > function. However, the function is supposed to be recursive, > so we should continue to look at integer suboperands even if > the outer operation is a vector one. > > This patch instead splits out the non-recursive parts > of make_compound_operation into a subroutine and checks > that the mode is a scalar integer before calling it. > The patch was originally written to help with the later > conversion to static type checking of mode classes, but it > also happened to reenable optimisation of things like > vec_duplicate operands. > > Note that the gen_lowparts in the PLUS and MINUS cases > were redundant, since new_rtx already had mode "mode" > at those points. > > Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Yes, please do. You can use maybe_swap_commutative_operands in change_zero_ext as well, perhaps in more places, do you want to take a look? Thanks, Segher