This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types
- From: Chung-Ju Wu <jasonwucj at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 19 Jun 2013 15:02:38 +0800
- Subject: Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types
- References: <51C12EC5 dot 709 at redhat dot com>
2013/6/19 Jeff Law <law@redhat.com>:
>
> * gcc.dg/tree-ssa/forwprop-28.c: New test.
>
In the gnu coding standard we have a space before
the open-parentheses. Would that be great to have
testcase follow this convention as well? :)
If so, then...
>
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c
> b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c
> new file mode 100644
> index 0000000..2c42065
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c
> @@ -0,0 +1,76 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-forwprop1" } */
> +
> +extern char * frob (void);
> +extern _Bool testit(void);
Missing a space before '('.
> +
> +test (int code)
> +{
> + char * temp = frob();;
Likewise. And redundant ';'.
> + int rotate = (code == 22);
> + if (temp == 0 && !rotate)
> + oof();
Likewise.
> +}
> +
> +test_2 (int code)
> +{
> + char * temp = frob();
Likewise.
> + int rotate = (code == 22);
> + if (!rotate && temp == 0)
> + oof();
Likewise.
And there are similar cases can be fixed in test_3, test_4,
test_5, test_6, test_7, and test_8.
Best regards,
jasonwucj