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] Make infer_loop_bounds_from_ref handle MEM_REFs, fix PR63278


On Thu, Oct 16, 2014 at 03:44:50PM +0200, Richard Biener wrote:
> --- gcc/testsuite/gcc.dg/tree-ssa/loop-42.c	(revision 0)
> +++ gcc/testsuite/gcc.dg/tree-ssa/loop-42.c	(working copy)
> @@ -0,0 +1,19 @@
> +/* { dg-do run } */
> +/* { dg-options "-O2 -fdump-tree-cunroll-details" } */
> +
> +extern void abort (void);
> +int a = -1;
> +int n = sizeof (int);
> +int main()
> +{
> +  char *p;
> +  int i;
> +  for (i = 0, p = (char *)&a; i < n; ++i)
> +    *p++ = 0;
> +  if (a != 0)
> +    abort ();
> +  return 0;
> +}
> +
> +/* { dg-final { scan-tree-dump "loop with 4 iterations completely unrolled" "cunroll" } } */

This will fail on all targets where sizeof (int) is not 4 :(.
So, I think you need to guard this scan-tree-dump with { target int32 }.

	Jakub


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