public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: Jan Hubicka <hubicka@ucw.cz>, Richard Biener <rguenther@suse.de>,
		Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>,
	gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFC] ipa bitwise constant propagation
Date: Fri, 26 Aug 2016 17:23:00 -0000	[thread overview]
Message-ID: <CAAgBjMkkAWcT9wEugG0+o3Hn7yrozggN9gUAsVNz0KmfSg6CuA@mail.gmail.com> (raw)
In-Reply-To: <yddlgzjcxde.fsf@CeBiTec.Uni-Bielefeld.DE>

On 26 August 2016 at 21:53, Rainer Orth <ro@cebitec.uni-bielefeld.de> 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  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         * gcc.dg/ipa/propbits-2.c: Add -fdump-tree-optimized to dg-options.
>         Fix typo.
>
>
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>

  reply	other threads:[~2016-08-26 17:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04  6:36 Prathamesh Kulkarni
2016-08-04  8:02 ` Richard Biener
2016-08-04  8:57   ` Prathamesh Kulkarni
2016-08-04  9:07     ` kugan
2016-08-04 10:51     ` Richard Biener
2016-08-04 13:05   ` Jan Hubicka
2016-08-04 23:04     ` kugan
2016-08-05 11:36       ` Jan Hubicka
2016-08-05 12:37 ` Martin Jambor
2016-08-07 21:38   ` Prathamesh Kulkarni
2016-08-08 14:04     ` Martin Jambor
2016-08-08 14:29       ` David Malcolm
2016-08-09  8:11       ` Prathamesh Kulkarni
2016-08-09  9:24         ` Richard Biener
2016-08-09 11:09         ` Martin Jambor
2016-08-09 11:47           ` Prathamesh Kulkarni
2016-08-09 18:13             ` Martin Jambor
2016-08-10  8:45               ` Prathamesh Kulkarni
2016-08-10 11:35                 ` Prathamesh Kulkarni
2016-08-11 12:55                   ` Jan Hubicka
2016-08-12  9:54                     ` Prathamesh Kulkarni
2016-08-12 14:04                       ` Jan Hubicka
2016-08-16 13:05                         ` Prathamesh Kulkarni
2016-08-22 13:33                           ` Martin Jambor
2016-08-22 13:55                             ` Prathamesh Kulkarni
2016-08-24 12:07                               ` Prathamesh Kulkarni
2016-08-25 13:44                                 ` Jan Hubicka
2016-08-26 12:31                                   ` Prathamesh Kulkarni
2016-08-26 16:23                                 ` Rainer Orth
2016-08-26 17:23                                   ` Prathamesh Kulkarni [this message]
2016-08-29 10:53                                     ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAgBjMkkAWcT9wEugG0+o3Hn7yrozggN9gUAsVNz0KmfSg6CuA@mail.gmail.com \
    --to=prathamesh.kulkarni@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=kugan.vivekanandarajah@linaro.org \
    --cc=rguenther@suse.de \
    --cc=ro@cebitec.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).