This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix compute_antic (PR tree-optimization/36508)
- From: Richard Guenther <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Jun 2008 13:42:18 +0200 (CEST)
- Subject: Re: [PATCH] Fix compute_antic (PR tree-optimization/36508)
- References: <20080623095311.GW8133@devserv.devel.redhat.com>
On Mon, 23 Jun 2008, Jakub Jelinek wrote:
> Hi!
>
> As has been discussed in the PR, 50 iterations provably can be reached on
> real-world, non-artificial, testcase and the checking should be done
> only in the --enable-checking compilers.
>
> Bootstrapped/regtested on i686-linux, ok for trunk/4.3?
Ok.
Thanks,
Richard.
> 2008-06-23 Jakub Jelinek <jakub@redhat.com>
>
> PR tree-optimization/36508
> * tree-ssa-pre.c (compute_antic): Allow num_iterations up to
> 499, don't check it at all in release compilers.
>
> * gcc.dg/pr36508.c: New test.
>
> --- gcc/tree-ssa-pre.c.jj 2008-06-23 08:40:36.000000000 +0200
> +++ gcc/tree-ssa-pre.c 2008-06-23 08:45:35.000000000 +0200
> @@ -2094,8 +2094,10 @@ compute_antic (void)
> block->index));
> }
> }
> +#ifdef ENABLE_CHECKING
> /* Theoretically possible, but *highly* unlikely. */
> - gcc_assert (num_iterations < 50);
> + gcc_assert (num_iterations < 500);
> +#endif
> }
>
> statistics_histogram_event (cfun, "compute_antic iterations",
> @@ -2124,8 +2126,10 @@ compute_antic (void)
> block->index));
> }
> }
> +#ifdef ENABLE_CHECKING
> /* Theoretically possible, but *highly* unlikely. */
> - gcc_assert (num_iterations < 50);
> + gcc_assert (num_iterations < 500);
> +#endif
> }
> statistics_histogram_event (cfun, "compute_partial_antic iterations",
> num_iterations);
> --- gcc/testsuite/gcc.dg/pr36508.c.jj 2008-06-23 09:06:37.000000000 +0200
> +++ gcc/testsuite/gcc.dg/pr36508.c 2008-06-23 09:06:10.000000000 +0200
> @@ -0,0 +1,29 @@
> +/* PR tree-optimization/36508 */
> +/* { dg-do compile } */
> +/* { dg-options "-O -ftree-pre" } */
> +
> +void
> +foo (short *sp)
> +{
> + int k;
> + k = 1;
> +#define SP0 *sp++ = 1;
> + while (1)
> + {
> + if (k > 6)
> + break;
> + SP0
> + k++;
> + }
> + k = 1;
> + while (1)
> + {
> + if (k > 6)
> + break;
> + SP0
> + k++;
> + }
> +#define SP1 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0
> +#define SP2 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1
> + SP2
> +}
>
> Jakub
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex