From patchwork Fri Aug 26 16:23:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 663179 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 3sLRFN2FCtz9sRB for ; Sat, 27 Aug 2016 02:24:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=K6Zyko4e; 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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=QbrRgOsK2ljjrF3C 0P4KArhMtFhfjBIMW5vmaNhqqk0jqBvB3SJgQ2NPoZBDxItgFWgoWDAU1V2+RVzd pThFls5XvnztgxHchoaoRSqujWmn/lBzt2Um23Il06+LkAoJEX1k5MYvJQF86EdK CfRlnCsIzT8RtmcEJ1O559+xfEA= 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:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=o8m0pkIUwkXJ9X7PYd+yR5 wcaEo=; b=K6Zyko4eJ92mbUpaheQ5hRj8eDSpc2R7oySNbvfzGmbRmAA6VqO0Tv RzEqNqQ7jmjMUSzTElLzfHhOICd+nD1EpywyuKaPY1SU9oXBBlTu05RcG0XTzksu AElPVYHAh96BrvRZpXi03JAJ5HX+WkkUG2wejVDgyE/KlFjBRiLNs= Received: (qmail 2895 invoked by alias); 26 Aug 2016 16:23:58 -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 2883 invoked by uid 89); 26 Aug 2016 16:23:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=testresults, survives, meet X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Aug 2016 16:23:48 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id AB057242; Fri, 26 Aug 2016 18:23:45 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eCnuahKljty9; Fri, 26 Aug 2016 18:23:42 +0200 (CEST) Received: from fuego.CeBiTec.Uni-Bielefeld.DE (p5DCE3D9E.dip0.t-ipconnect.de [93.206.61.158]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 7E984240; Fri, 26 Aug 2016 18:23:42 +0200 (CEST) From: Rainer Orth To: Prathamesh Kulkarni Cc: Jan Hubicka , Richard Biener , Kugan Vivekanandarajah , gcc Patches Subject: Re: [RFC] ipa bitwise constant propagation References: <20160809110933.2dpy7qdepugoknp2@virgil.suse.cz> <20160809181309.erlp4yxnc5otdtxm@virgil.suse.cz> <20160811125540.GA36505@kam.mff.cuni.cz> <20160812140347.GC68714@kam.mff.cuni.cz> <20160822133316.7w7ddrwuft7svyj6@virgil.suse.cz> Date: Fri, 26 Aug 2016 18:23:41 +0200 In-Reply-To: (Prathamesh Kulkarni's message of "Wed, 24 Aug 2016 17:36:57 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Hi Prathamesh, > The attached version passes bootstrap+test on > x86_64-unknown-linux-gnu, ppc64le-linux-gnu, > and with c,c++,fortran on armv8l-linux-gnueabihf. > Cross-tested on arm*-*-* and aarch64*-*-*. > Verified the patch survives lto-bootstrap on x86_64-unknown-linux-gnu. > Ok to commit ? [...] > testsuite/ > * gcc.dg/ipa/propbits-1.c: New test-case. > * gcc.dg/ipa/propbits-2.c: Likewise. > * gcc.dg/ipa/propbits-3.c: Likewise. [...] > diff --git a/gcc/testsuite/gcc.dg/ipa/propbits-2.c b/gcc/testsuite/gcc.dg/ipa/propbits-2.c > new file mode 100644 > index 0000000..3a960f0 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/ipa/propbits-2.c > @@ -0,0 +1,41 @@ > +/* x's mask should be meet(0xc, 0x3) == 0xf */ > + > +/* { dg-do compile } */ > +/* { dg-options "-O2 -fno-early-inlining -fdump-ipa-cp" } */ > + > +extern int pass_test (); > +extern int fail_test (); > + > +__attribute__((noinline)) > +static int f1(int x) > +{ > + if ((x & ~0xf) == 0) > + return pass_test (); > + else > + return fail_test (); > +} > + > +__attribute__((noinline)) > +static int f2(int y) > +{ > + return f1(y & 0x03); > +} > + > +__attribute__((noinline)) > +static int f3(int z) > +{ > + return f1(z & 0xc); > +} > + > +extern int a; > +extern int b; > + > +int main(void) > +{ > + int k = f2(a); > + int l = f3(b); > + return k + l; > +} > + > +/* { dg-final { scan-ipa-dump "Adjusting mask for param 0 to 0xf" "cp" } } */ > +/* { dg-final { scan-dump-tree-not "fail_test" "optimized" } } */ This testcase thoroughly broke make check-gcc: At first, runtest errors out with ERROR: (DejaGnu) proc "scan-dump-tree-not fail_test optimized" does not exist. The resulting incomplete gcc.sum files confuse dg-extract-results.py testsuite/gcc6/gcc.sum.sep: no recognised summary line testsuite/gcc6/gcc.log.sep: no recognised summary line and cause it to emit en empty gcc.sum, effectively losing all gcc testresults in mail-report.log. This cannot have been tested in any reasonable way. Once you fix the typo (scan-dump-tree-not -> scan-tree-dump-not), at least we get a complete gcc.sum again, but the testcase still shows up as UNRESOLVED: gcc.dg/ipa/propbits-2.c scan-tree-dump-not optimized "fail_test" and gcc.log shows gcc.dg/ipa/propbits-2.c: dump file does not exist Adding -fdump-tree-optimized creates the necessary dump and finally lets the test pass. Here's the resulting patch. Unless there are objections, I plan to commit it soon. Rainer 2016-08-26 Rainer Orth * gcc.dg/ipa/propbits-2.c: Add -fdump-tree-optimized to dg-options. Fix typo. diff --git a/gcc/testsuite/gcc.dg/ipa/propbits-2.c b/gcc/testsuite/gcc.dg/ipa/propbits-2.c --- a/gcc/testsuite/gcc.dg/ipa/propbits-2.c +++ b/gcc/testsuite/gcc.dg/ipa/propbits-2.c @@ -1,7 +1,7 @@ /* x's mask should be meet(0xc, 0x3) == 0xf */ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-early-inlining -fdump-ipa-cp" } */ +/* { dg-options "-O2 -fno-early-inlining -fdump-ipa-cp -fdump-tree-optimized" } */ extern int pass_test (); extern int fail_test (); @@ -38,4 +38,4 @@ int main(void) } /* { dg-final { scan-ipa-dump "Adjusting mask for param 0 to 0xf" "cp" } } */ -/* { dg-final { scan-dump-tree-not "fail_test" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "fail_test" "optimized" } } */