From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14926 invoked by alias); 26 Aug 2016 17:23:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14908 invoked by uid 89); 26 Aug 2016 17:23:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=survives, testresults, propbits2c, gcc.sum.sep X-HELO: mail-it0-f45.google.com Received: from mail-it0-f45.google.com (HELO mail-it0-f45.google.com) (209.85.214.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Aug 2016 17:23:00 +0000 Received: by mail-it0-f45.google.com with SMTP id e63so2305613ith.1 for ; Fri, 26 Aug 2016 10:23:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zHzCNJWN5bYmjiCDueEdM3Ho1V0rs5qrBu1A5lITMUc=; b=Z9UB1m+O7WZcxrfBD9nDsyL+qOXkpmzAbw7A1YBiRM+hAial/MeDempw0aJEaNCsTM wm3ZlgwEi4RtL7clZmCxsktA6gh5kvw5heUVlRWLWvPiinuI/3GrDn7wp8ZfQR6dEQfa TfsgWZfl1XBXbi9aWiDkJgCLoC1bLiuxXzFOUpgyia9KVrLhGlDJnUhyffoV++TVKskI kHuvAiitfEKKaxJ0LtpNMLHwq503KBE54HHDOOfJY1jseHRHObqff+xARF+aLG5uPJ5X Aas+RP28FXJ2hPsSolyNYrJXe40EX3OdFbNJAuJdvSXLOFPFkcWjnkzvAZKdJvAnoKPZ ZgJA== X-Gm-Message-State: AE9vXwOg7q/LYPmDs177WreaZWOy8nMXoA/TUP3IpUGyLga1K98AwFHujs2dcInzky+raNMYnPu47nBKJPt3tcwp X-Received: by 10.107.159.147 with SMTP id i141mr5254238ioe.29.1472232178917; Fri, 26 Aug 2016 10:22:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.208.18 with HTTP; Fri, 26 Aug 2016 10:22:58 -0700 (PDT) In-Reply-To: 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> From: Prathamesh Kulkarni Date: Fri, 26 Aug 2016 17:23:00 -0000 Message-ID: Subject: Re: [RFC] ipa bitwise constant propagation To: Rainer Orth Cc: Jan Hubicka , Richard Biener , Kugan Vivekanandarajah , gcc Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg01883.txt.bz2 On 26 August 2016 at 21:53, Rainer Orth wrote: > 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: Oops, sorry for the breakage. I am not sure how this missed my testing :/ I obtained test results using test_summary script with and without patch, and compared the results with compare_tests which apparently showed no regressions... Thanks for the fix. Thanks, Prathamesh > > 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. > > > > -- > ----------------------------------------------------------------------------- > Rainer Orth, Center for Biotechnology, Bielefeld University >