From patchwork Sat Jul 20 06:45:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1134359 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-505360-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="kWCnUr4N"; 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 45rJKt1hsqz9s4Y for ; Sat, 20 Jul 2019 16:45:53 +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:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=SH8SHl9d0YjaeHlSY 5vH18rVyWStT1fWwRzBgTf7MJ3enpnBxR29TwpmvvhZOPj7/Rnr/B8nsZnlNGJ0K KHpshKCZvO/GIbWzowDZwydrWb9JxczixHkQAuoVKTkVLQksRR3EeuY9L8Sk0JYT sbL46teMemxaDJrF35NJoOQDhI= 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:references:mime-version :content-type:in-reply-to; s=default; bh=Tuk64F5MfEs+y/RbE13+jzG H7ZQ=; b=kWCnUr4NJxuxpiAU3gEFWzvg4FfXpntnPdUqq6ntnFi7VU3f9+2w7yI RdZ7PzbDdsBeYwkC7cCfdZ9ID9jg79ZFGlaj7xSGHzRQRJsUs+gXq2KmKMxERHIS 3fTwgOwptOuW4PR1KbODKgPXgoJDAHsVmJN3s7sYTlBqtks2iGGM= Received: (qmail 4786 invoked by alias); 20 Jul 2019 06:45:46 -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 4774 invoked by uid 89); 20 Jul 2019 06:45:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 20 Jul 2019 06:45:44 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 751DAC079901; Sat, 20 Jul 2019 06:45:43 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-236.ams2.redhat.com [10.36.116.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08F375C675; Sat, 20 Jul 2019 06:45:42 +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 x6K6jeun007933; Sat, 20 Jul 2019 08:45:41 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x6K6jcPp007932; Sat, 20 Jul 2019 08:45:38 +0200 Date: Sat, 20 Jul 2019 08:45:38 +0200 From: Jakub Jelinek To: Richard Biener , Jeff Law , Eric Botcazou , Uros Bizjak Cc: "gcc-patches@gcc.gnu.org" Subject: [PATCH]: Fix ICE in expand_expr_real_2 (PR target/91204) Message-ID: <20190720064538.GB2125@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes On Fri, Jul 19, 2019 at 04:41:06PM +0200, Uros Bizjak wrote: > As suggested by Jakub in the PR, add missing vector one_cmpl2 to > mmx.md. A generic fix is in the works by Jakub. Yes, here it is. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2019-07-20 Jakub Jelinek PR target/91204 * optabs.c (expand_unop): As fallback, expand ~op0 as op0 ^ -1. * gcc.c-torture/compile/pr91204.c: New test. Jakub --- gcc/optabs.c.jj 2019-07-15 10:53:10.743205405 +0200 +++ gcc/optabs.c 2019-07-19 00:38:20.271852242 +0200 @@ -2972,6 +2972,17 @@ expand_unop (machine_mode mode, optab un return target; } + /* Emit ~op0 as op0 ^ -1. */ + if (unoptab == one_cmpl_optab + && (SCALAR_INT_MODE_P (mode) || GET_MODE_CLASS (mode) == MODE_VECTOR_INT) + && optab_handler (xor_optab, mode) != CODE_FOR_nothing) + { + temp = expand_binop (mode, xor_optab, op0, CONSTM1_RTX (mode), + target, unsignedp, OPTAB_DIRECT); + if (temp) + return temp; + } + if (optab_to_code (unoptab) == NEG) { /* Try negating floating point values by flipping the sign bit. */ --- gcc/testsuite/gcc.c-torture/compile/pr91204.c.jj 2019-07-19 09:29:32.366011373 +0200 +++ gcc/testsuite/gcc.c-torture/compile/pr91204.c 2019-07-19 09:29:11.011340662 +0200 @@ -0,0 +1,11 @@ +/* PR target/91204 */ + +int a, b, c[64]; + +void +foo (void) +{ + int i; + for (i = 2; i < 64; i++) + c[i] &= b ^ c[i] ^ c[i - 2]; +}