From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26162 invoked by alias); 29 Aug 2016 10:53:50 -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 26152 invoked by uid 89); 29 Aug 2016 10:53:49 -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,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=hmmm, sk:dgextr, UD:dg-extract-results.py, Hx-spam-relays-external:209.85.216.179 X-HELO: mail-qt0-f179.google.com Received: from mail-qt0-f179.google.com (HELO mail-qt0-f179.google.com) (209.85.216.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Aug 2016 10:53:39 +0000 Received: by mail-qt0-f179.google.com with SMTP id w38so66116364qtb.0 for ; Mon, 29 Aug 2016 03:53:38 -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=U3Fc12Ceh3lRUDn+0tWOUmcYvboHInGqK/VH679ChdU=; b=AigZ5HtQUJ3SzPMSv6j/QG/gRd2C+iv23T7hbaTdZDzfrIMiGU+iG25QHHFj2rgTaZ sEd2e82yTXS6bZD7iQWOd556PdyRtylVGpN0UC6Tlu3VRmcXA004JWI7MUsCUuSbvtsW cffmEZWoKv0zLn3x0FhjPvc1JFg1TINx8pI+i/Q5PaUGFyhqubSKvjwq9TbDBeKysftO 1P2mUV8Ugm7PW7zt7/N1xR6OSEF12QCkO6Rmdzqcw0YtqRudx6jz12Eo3gPlYtzoGww9 6G7C+r7hoNjUXqx8szt2q6H8Gh5hNfRff9hgA+x6xhgtQr9BWLKvc7WIgbEjTyF91FF3 kU/Q== X-Gm-Message-State: AE9vXwNMAOK2FnhdLIAu5mpfRy7dfayFgyTeYKhkYegpeW6h1fi1PX5GobyIH51oecvCqkxA6YHDW+sLM4sb3QkH X-Received: by 10.200.48.146 with SMTP id v18mr17851088qta.107.1472468017386; Mon, 29 Aug 2016 03:53:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.21.9 with HTTP; Mon, 29 Aug 2016 03:53:36 -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: Christophe Lyon Date: Mon, 29 Aug 2016 10:53:00 -0000 Message-ID: Subject: Re: [RFC] ipa bitwise constant propagation To: Prathamesh Kulkarni Cc: Rainer Orth , Jan Hubicka , Richard Biener , Kugan Vivekanandarajah , gcc Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg01944.txt.bz2 On 26 August 2016 at 19:22, Prathamesh Kulkarni wrote: > 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. > Hmmm that's weird indeed. > Thanks, > Prathamesh >> >> At first, runtest errors out with >> >> ERROR: (DejaGnu) proc "scan-dump-tree-not fail_test optimized" does not exist. I do see this message in gcc.log (and in gcc.sum), but... >> >> 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 >> .... I do not see this... >> and cause it to emit en empty gcc.sum, effectively losing all gcc >> testresults in mail-report.log. and gcc.sum looks quite good (except for the ERROR: message which is not noticed by the comparison tools). It could be an effect of a different 'make -j' value, resulting in different split of gcc.sum.sep, thus making the error un-noticed. Christophe >> 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 >>