From patchwork Mon Apr 25 14:25:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 614495 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 3qtpRY2tF7z9t5X for ; Tue, 26 Apr 2016 00:25:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=RNO+LnGT; 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=GYsveQ4ZytM8iTRry uFw81E+Apnl5yDK28bBQFMWcY0WnddkI4AwoRKuYF+dvzNgmJ2tV8Xxf2m4fwcMB JOqP4Zl6JXhSGBmc8Uyct56GEdVtclnAX5OXerZpSST+kxX1/8Ey9KWaKqNzXSPQ eHqiZYGSyyM4aMvrPl3AP9A36w= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=n1nFr/hs0rH3gQ/3GjXazhH Sfc0=; b=RNO+LnGT+Hd56MAaedxfJEUCYJxkyO0nGojpiuyZesajRkLtIMtTYuk GY1Viw0M8L0op/CKwcIFhd7wEdHcvcveHu22qanVTPCPAPkP1pbpZvT/N/DUfqVW uImduLj4jCWH2ZIEYeSlsyse4rPbm4S0619janRiSteOdZpmdeuI= Received: (qmail 68137 invoked by alias); 25 Apr 2016 14:25:37 -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 68112 invoked by uid 89); 25 Apr 2016 14:25:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=matchpd, UD:pd, match.pd, UD:match.pd X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Apr 2016 14:25:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EEE333A; Mon, 25 Apr 2016 07:24:03 -0700 (PDT) Received: from [10.2.206.43] (e100706-lin.cambridge.arm.com [10.2.206.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5581D3F25F; Mon, 25 Apr 2016 07:25:22 -0700 (PDT) Message-ID: <571E28D0.5010804@foss.arm.com> Date: Mon, 25 Apr 2016 15:25:20 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Marc Glisse CC: gcc-patches@gcc.gnu.org Subject: Re: match.pd patch: min(-x, -y), min(~x, ~y) References: <5719EC75.2040509@foss.arm.com> <5719F22D.5020501@foss.arm.com> <5719F5A6.9050806@foss.arm.com> <571A090B.50803@foss.arm.com> In-Reply-To: <571A090B.50803@foss.arm.com> On 22/04/16 12:20, Kyrill Tkachov wrote: > > On 22/04/16 11:34, Marc Glisse wrote: >> On Fri, 22 Apr 2016, Kyrill Tkachov wrote: >> >>> >>> On 22/04/16 10:43, Kyrill Tkachov wrote: >>>> >>>> On 22/04/16 10:42, Marc Glisse wrote: >>>>> On Fri, 22 Apr 2016, Kyrill Tkachov wrote: >>>>> >>>>>>> 2016-04-21 Marc Glisse >>>>>>> >>>>>>> gcc/ >>>>>>> * match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(~x, ~y)): >>>>>>> New transformations. >>>>>>> >>>>>>> gcc/testsuite/ >>>>>>> * gcc.dg/tree-ssa/minmax-2.c: New testcase. >>>>>>> >>>>>>> >>>>>> >>>>>> I see the new testcase failing on aarch64: >>>>>> FAIL: gcc.dg/tree-ssa/minmax-2.c scan-tree-dump optimized "__builtin_fmin" >>>>> >>>>> Strange, it seems to work in https://gcc.gnu.org/ml/gcc-testresults/2016-04/msg02120.html >>>>> >>>>> Is that on some freestanding kind of setup where the builtin might be disabled? >>>>> >>>> >>>> Ah, this is aarch64-none-elf which uses newlib as the C library. >>>> Let me check on aarch64-none-linux-gnu and get back to you. >>>> >>> >>> Yeah, I see it passing on aarch64-none-linux-gnu. >>> Do we have an appropriate effective target check to gate this test on? >> >> I don't know, I have a hard time finding something related. I am not even convinced the test should be skipped. It looks like __builtin_fmax was recognized, otherwise you would get a warning and a conversion int-double. Maybe >> gimple_call_combined_fn rejects it? Ah, builtins.def declares it with DEF_C99_BUILTIN, which checks targetm.libc_has_function (function_c99_misc). I assume newlib fails that check? That would make c99_runtime a relevant target check. >> > > Yeah, adding the below makes this test UNSUPPORTED on aarch64-none-elf. > /* { dg-add-options c99_runtime } */ > /* { dg-require-effective-target c99_runtime } */ > > I'll prepare a patch. > Sorry for the delay, here it is. Ok to commit? Thanks, Kyrill 2016-04-25 Kyrylo Tkachov * gcc.dg/tree-ssa/minmax-2.c: Require c99_runtime and add the associated options. > Thanks, > Kyrill diff --git a/gcc/testsuite/gcc.dg/tree-ssa/minmax-2.c b/gcc/testsuite/gcc.dg/tree-ssa/minmax-2.c index 98c38b1aa773d04a5d7cb36df73db8924d83ed65..87ff94cef1f3b178b315358f246c9a3f32383945 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/minmax-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/minmax-2.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O -fstrict-overflow -fdump-tree-optimized" } */ +/* { dg-add-options c99_runtime } */ +/* { dg-require-effective-target c99_runtime } */ static int max(int a,int b){return (a