From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 925 invoked by alias); 27 Feb 2018 14:22:28 -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 908 invoked by uid 89); 27 Feb 2018 14:22:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f42.google.com Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 14:22:26 +0000 Received: by mail-wm0-f42.google.com with SMTP id 191so24143300wmm.4 for ; Tue, 27 Feb 2018 06:22:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=p2OQoC4lAi4XUOw59tx0mzIp/URKEcbxIT2S1y1l0lQ=; b=G4V6VxpVRtsv1EZVtSvzPQM5ZJZGETT3lUypc2XIyD/AJmQtXSRNeklmikTGFKyTh9 ia+gVCppZa7t8NxJy4b0yc9F3Th+JDlCyx86E29/2YkKd80fTro3SN7hr0BO4JGo99cy +GLvZyDY48RYS38fJL8UAVjjfHCC8krbkYfCLAr+gsI9vQF4V8x+tkA6he7HAH/1A87y 6lRcLyfWcqnhp/0OlfVn654RD7sRaoUnB1Xd4KDub59J+QeW/eiuH1WfGv9ZLWIkyJmE uuT6VSBpi2jHdOcLez/+z1HFMvlclzrq6QU6gpgWEyi+K2IUf78RW8qC2xZ0RwCn+8Fg Mj7w== X-Gm-Message-State: APf1xPCnvN78peG2xlGxOuviRLi6OeOJ2X2hMqt2H+RLWnPNyOAl9d3J RVRHyHqpE4Fs6jfxeZzmjB9em8ASNos= X-Google-Smtp-Source: AG47ELua0AcfL6aia+oTCbvVNHZ2jVPVg8uk4HVYHScE+Z29JkfRFDjPyxwg7oYL6KTxpmfEqqI6Gw== X-Received: by 10.28.185.83 with SMTP id j80mr12111668wmf.69.1519741344149; Tue, 27 Feb 2018 06:22:24 -0800 (PST) Received: from localhost ([217.140.96.141]) by smtp.gmail.com with ESMTPSA id y145sm11300380wmd.43.2018.02.27.06.22.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 06:22:23 -0800 (PST) From: Richard Sandiford To: Jakub Jelinek Mail-Followup-To: Jakub Jelinek ,Richard Earnshaw , James Greenhalgh , Marcus Shawcroft , gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Cc: Richard Earnshaw , James Greenhalgh , Marcus Shawcroft , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix aarch64_simd_reg_or_zero predicate (PR fortran/84565) References: <20180227091251.GD5867@tucnak> Date: Tue, 27 Feb 2018 14:22:00 -0000 In-Reply-To: <20180227091251.GD5867@tucnak> (Jakub Jelinek's message of "Tue, 27 Feb 2018 10:12:51 +0100") Message-ID: <87muzuh5r5.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-02/txt/msg01502.txt.bz2 Jakub Jelinek writes: > Hi! > > The following testcase ICEs, because the aarch64_cmeqdf instruction > starting with r256612 no longer accepts CONST0_RTX (E_DFmode) as > valid argument, but the expander generates it anyway. > > The bug has been introduced during the addition of aarch64_simd_imm_zero > and aarch64_simd_or_scalar_imm_zero predicates, before the predicate > used to be: > (define_predicate "aarch64_simd_reg_or_zero" > (and (match_code "reg,subreg,const_int,const_double,const_vector") > (ior (match_operand 0 "register_operand") > (ior (match_test "op == const0_rtx") > (match_test "aarch64_simd_imm_zero_p (op, mode)"))))) > with > bool > aarch64_simd_imm_zero_p (rtx x, machine_mode mode) > { > return x == CONST0_RTX (mode); > } > and so matched not just const,const_vector zeros, but also > const_int zero (that is through op == const0_rtx) and const_double > zero too. Thanks for fixing this. > Bootstrapped/regtested on aarch64-linux (scratch Fedora gcc 8 package build > with the patch applied), ok for trunk? > > 2018-02-27 Jakub Jelinek > > PR fortran/84565 > * config/aarch64/predicates.md (aarch64_simd_reg_or_zero): Use > aarch64_simd_or_scalar_imm_zero rather than aarch64_simd_imm_zero. > > * gfortran.dg/pr84565.f90: New test. > > --- gcc/config/aarch64/predicates.md.jj 2018-02-06 13:13:06.305751221 +0100 > +++ gcc/config/aarch64/predicates.md 2018-02-26 16:30:01.902195208 +0100 > @@ -395,7 +395,7 @@ (define_predicate "aarch64_simd_reg_or_z > (and (match_code "reg,subreg,const_int,const_double,const,const_vector") > (ior (match_operand 0 "register_operand") > (match_test "op == const0_rtx") > - (match_operand 0 "aarch64_simd_imm_zero")))) > + (match_operand 0 "aarch64_simd_or_scalar_imm_zero")))) I think this makes the match_test on the line above redundant. LGTM otherwise (but I can't approve). We should probably clean up the predicates so that the zero checks are more consistent. genrecog could probably help by ignoring predicate codes that obviously don't apply (CONST_INT for vectors, CONST_VECTOR for ints, etc.). But that's obviously all stage 1 stuff. Richard