From patchwork Tue Apr 17 16:39:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 899450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476484-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="f5yMls16"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40QWDY0LYLz9s1d for ; Wed, 18 Apr 2018 02:39:24 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=Na+nGxQEIwS/HqhstlIKqCuaz+/Uk TIgyx2qzXbSIyaghglI9UddQj4gcEuGyb0cvNr38BA9PLP2E3qo2Of2xHREPi5G6 QvO/SVF0nDBMGoq3qZnGF8dIEqjce1Dp4Ie9dQV7un5ASXlg6povsXAMAJycqeht N69QgXfDQTM+e8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=tiKHdu5OBVmgAjY4TwMsTg6Rg1A=; b=f5y Mls16viE0PdlEtGRDkANnv/Ki6I7fIzN5WjFeYiiBsP4HzeMujgKMRtPUGdNrkGY Ozb3e3Ts+vfsxtNepGotd7juAVglLH+orMG1kkn6CaP3Gy2uHEWzNciOyYeaabEX MKOh8AVCBynuL8g9ik2mpPB5H5pczR/YvTsrjt0k= Received: (qmail 28329 invoked by alias); 17 Apr 2018 16:39:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 28130 invoked by uid 89); 17 Apr 2018 16:39:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Apr 2018 16:39:14 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6D1B406E8B9; Tue, 17 Apr 2018 16:39:12 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.36.118.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4F402166BAE; Tue, 17 Apr 2018 16:39:12 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w3HGdA9u011570; Tue, 17 Apr 2018 18:39:10 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w3HGd9NH011569; Tue, 17 Apr 2018 18:39:09 +0200 Date: Tue, 17 Apr 2018 18:39:09 +0200 From: Jakub Jelinek To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix type attr of x86 *ashlqi3_1_slp insn (PR target/85430) Message-ID: <20180417163909.GF8577@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes Hi! This define_insn has just 2 match_operands, so using alu type for it without defining memory attr is incorrect and can result in ICEs. My understanding is that alu1 is exactly what we want here. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2018-04-17 Jakub Jelinek PR target/85430 * config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu. * gcc.dg/pr85430.c: New test. Jakub --- gcc/config/i386/i386.md.jj 2018-04-05 20:34:31.989020754 +0200 +++ gcc/config/i386/i386.md 2018-04-17 13:22:08.134050850 +0200 @@ -10713,7 +10713,7 @@ (define_insn "*ashlqi3_1_slp" { switch (get_attr_type (insn)) { - case TYPE_ALU: + case TYPE_ALU1: gcc_assert (operands[1] == const1_rtx); return "add{b}\t%0, %0"; @@ -10729,12 +10729,12 @@ (define_insn "*ashlqi3_1_slp" (cond [(and (and (match_test "TARGET_DOUBLE_WITH_ADD") (match_operand 0 "register_operand")) (match_operand 1 "const1_operand")) - (const_string "alu") + (const_string "alu1") ] (const_string "ishift1"))) (set (attr "length_immediate") (if_then_else - (ior (eq_attr "type" "alu") + (ior (eq_attr "type" "alu1") (and (eq_attr "type" "ishift1") (and (match_operand 1 "const1_operand") (ior (match_test "TARGET_SHIFT1") --- gcc/testsuite/gcc.dg/pr85430.c.jj 2018-04-17 13:23:46.336087029 +0200 +++ gcc/testsuite/gcc.dg/pr85430.c 2018-04-17 13:23:22.653078309 +0200 @@ -0,0 +1,12 @@ +/* PR target/85430 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-ccp -fno-tree-fre" } */ + +typedef char V __attribute__((vector_size (4))); + +V +foo (V v) +{ + v[(V){}[0]] <<= 1; + return v; +}