From patchwork Tue Feb 16 13:19:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 583400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 04D4B140273 for ; Wed, 17 Feb 2016 00:19:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=JeQItHc/; dkim-atps=neutral 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:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=iJJP8MjAoms6Cz5Ui mMQwSf3qvKEavFWnxMYJTgpriXDNRSvqf40HIggXvGHBiBFBr0ukj+mfhr8HzNY4 iNy/kwCCuHhTIwEH+23ZJrYbSDESxMeKpM47G+x6S1mhFHV3O0AmBdZgFVhmFkbf BsR8kYpSzsGnv/rojR4qc1IAjk= 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:references:mime-version :content-type:in-reply-to; s=default; bh=/JOHYAr7EoSVbQPCQCSw+3M yNLA=; b=JeQItHc/l7JM8TfN4iogx8GLNHHXhw0Hgrx0usbvZsjmGRvPlI/I3+A d/fAwEsyRsM+sp/nHUxGFJJG31CO7d6ax+6PlESSSh72owKmcmjVmGidjdq2QlEj DNeYjcJh0lIN+ygRtuE8MoEe0644bdVu021NCi8DAM9Ju/sYg7kY= Received: (qmail 23771 invoked by alias); 16 Feb 2016 13:19:43 -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 23755 invoked by uid 89); 16 Feb 2016 13:19:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2066 X-HELO: mail-pf0-f175.google.com Received: from mail-pf0-f175.google.com (HELO mail-pf0-f175.google.com) (209.85.192.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 16 Feb 2016 13:19:39 +0000 Received: by mail-pf0-f175.google.com with SMTP id x65so105274643pfb.1 for ; Tue, 16 Feb 2016 05:19:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=+K87GngyK73ywb5bBiK9McCf477P56UiNJUDlgPQDvs=; b=XbFmTkFrPHsa2ggflRKY/UsEs67OE7e6IXglom+QYF7li3HJxOQm76CJupFoFCB11I JkAcn3bhbOf7OjDNi76NYx8uf4j30V0B2mGGtA2qZNZr7riIDaHb/peARbxlVBEmYaCj ierdGbxd0QTXb4cN/qK+UmCTeAjzs8lNfAKZQlv8HqEs5vL0tVsWwCBC6z3o3yaQBMtu FgI6WX9jgKnA1NnDp1QX4wwm51lN+7sWZBgFL8+8OHN2SgTuP1nYujd6HQqc8ZqRRQ0v 7Vxo6yOFJVYJ4RvIP15waUj7i7/cVdwif8W5XS4OyZq2q0dXS5pN7ngKFP/uqwMq5fz6 BYcg== X-Gm-Message-State: AG10YOQ4n47D8Oi+mAfqUhimyspQ+PyXX3dzaeexWGNIuwEdEFz05dq9ugebIwEoqILgrg== X-Received: by 10.98.12.29 with SMTP id u29mr30630371pfi.116.1455628777911; Tue, 16 Feb 2016 05:19:37 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-146-233.sa.bigpond.net.au. [58.160.146.233]) by smtp.gmail.com with ESMTPSA id dg12sm45978692pac.47.2016.02.16.05.19.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 05:19:36 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 26728EA0157; Tue, 16 Feb 2016 23:49:32 +1030 (ACDT) Date: Tue, 16 Feb 2016 23:49:32 +1030 From: Alan Modra To: "dje.gcc@gmail.com" Cc: "gcc-patches@gcc.gnu.org" , Edmar Wienskoski , Rohit Arul Raj D Subject: Re: RFC: [Patch, PR Bug 60818] - ICE in validate_condition_mode on powerpc*-linux-gnu* ] Message-ID: <20160216131931.GB31757@bubble.grove.modra.org> References: <20160216083058.GA31757@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160216083058.GA31757@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Tue, Feb 16, 2016 at 07:00:58PM +1030, Alan Modra wrote: > What's wrong is the rs6000 backend asserting that (gtu (reg:CC)) can't > happen, because obviously it does. Rather than trying to fix combine, > (where the ICE happens on attempting to validate the insn!), I think > the rs6000 backend should change. Like so. Not yet bootstrapped, > but I'm about to fire one off. > > PR target/60818 > * config/rs6000/rs6000.c (validate_condition_mode): Return a > bool rather than asserting modes as expected. Update all uses > to assert. > * config/rs6000/rs6000-protos.h (validate_condition_mode): > Update prototype. > * config/rs6000/predicates.md (branch_comparison_operator): > Use result of validate_condition_mode. Now bootstrapped and regression tested powerpc64le-linux and powerpc64-linux biarch, mainline, gcc-5 and gcc-4.9. With this testsuite addition. OK to apply? * gcc.target/powerpc/pr60818.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/pr60818.c b/gcc/testsuite/gcc.target/powerpc/pr60818.c new file mode 100644 index 0000000..773480b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr60818.c @@ -0,0 +1,62 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-O1 -mno-mfcrf -misel" } */ + +int d7; + +static int +ca(int l3) +{ + for (d7 = 0; d7 < 1; ++d7) + ; + return l3; +} + +int +c9(void) +{ + int yj; + return ca(((yj != 1) & 65535U) > d7); +} + + +int +kf(int a2, unsigned int dc) +{ + int t3; + int b1[2]; + for (t3 = 0; t3 < 2; ++t3) + b1[t3] = 2; + return ((t3 > a2) >= b1[0]) < dc; +} + + +void +ds(void) +{ + unsigned int t5; + unsigned int re; + int yn; + int *o2; + int *s0 = &yn; + for (re = 0; re < 2; ++re) + if (0 != t5) + *o2 = (*s0 ^= 1) | (re = ((t5 < yn) >= (t5 > yn))); +} + + +unsigned int ou; +int jv (void) +{ + unsigned int rg; + return rg < ou; +} + + +unsigned int vz, tr, c, fr; + +void +gi(void) +{ + if (vz < 1) + vz = ((fr < tr) >= (fr > tr)); +}