This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch gimplifier]: Do folding on truth and/or trees


On Wed, Apr 27, 2011 at 10:03:34PM +0200, Kai Tietz wrote:
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ gcc/gcc/testsuite/gcc.dg/binop-tand1.c	2011-04-27 21:31:19.276726900 +0200
> @@ -0,0 +1,14 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-optimized" } */
> +
> +int
> +foo (int a, int b, int c)
> +{
> +  return ((!a && !b) && c && b && c && a);

For testing of gimple-fold folding (rather than fold-const), it would be
nice if you could also test those expressions from multiple
source statements with some temporaries.  Otherwise, fold-const
will see everything together already when invoked from the FEs.

> +/* We expect to see "<bb N>"; confirm that, so that we know to count
> +   it in the real test.  */
> +/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */

Why do you test number of bb's?  I don't see how is that relevant to
whether it has been optimized or not.
On the other side, it would be nice if you could test your testcases with
a cross compiler on a couple of other targets (e.g. powerpc64-linux
-m32,-m64, and/or arm, s390 or something similar).  BRANCH_COST etc.
affect a lot how is this gimplified, and I believe there was a PR about
some of your recent testcases failing on powerpc.

You don't need to build cross binutils, all that is needed is
configure the cross and build just cc1, don't mind that the build
fails afterwards and just run it on your testcases by hand to see
what is in the dumps.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]