From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64438 invoked by alias); 17 Dec 2017 03:14:19 -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 64426 invoked by uid 89); 17 Dec 2017 03:14:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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; Sun, 17 Dec 2017 03:14:16 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id vBH3E9Wh012899; Sat, 16 Dec 2017 21:14:09 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id vBH3E8YN012895; Sat, 16 Dec 2017 21:14:08 -0600 Date: Sun, 17 Dec 2017 03:14:00 -0000 From: Segher Boessenkool To: James Greenhalgh Cc: gcc-patches@gcc.gnu.org, nd@arm.com, law@redhat.com Subject: Re: [Patch combine] Don't create vector mode ZERO_EXTEND from subregs Message-ID: <20171217031407.GJ10515@gate.crashing.org> References: <1513001933-17348-1-git-send-email-james.greenhalgh@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1513001933-17348-1-git-send-email-james.greenhalgh@arm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg01126.txt.bz2 Hi! On Mon, Dec 11, 2017 at 02:18:53PM +0000, James Greenhalgh wrote: > > In simplify_set we try transforming the paradoxical subreg expression: > > (set FOO (subreg:M (mem:N BAR) 0)) > > in to: > > (set FOO (zero_extend:M (mem:N BAR))) > > However, this code does not consider the case where M is a vector > mode, allowing it to construct (for example): > > (zero_extend:V4SI (mem:SI)) > > This would clearly have the wrong semantics, but fortunately we fail long > before then in expand_compound_operation. As we really don't want a vector > zero_extend of a scalar value. > > We need to explicitly reject vector modes from this transformation. It does not consider any other modes either. Both modes involved are required to be SCALAR_INT_MODE_P (for zero_extend to be valid at all and to be equivalent to the subreg); could you test for that instead please? Segher