On Fri, Jul 10, 2015 at 01:21:05PM +0100, Kyrill Tkachov wrote:
> Hi all,
> 
> Some of the testcases in aarch64.exp can fail their scan-assembler patterns
> if if-conversion becomes more aggressive.
>
> This patch adjusts the testcases in case the branches are eliminated and
> further optimisations occur that may remove the scan-assembler patterns.
>
> With this patch the patterns are always generated and the expected execute
> values are updated.
> 
> Tests still pass on aarch64.
> Ok for trunk?

This is OK. Please address my one comment below (looks like you left some
#if 0 kicking around in adds1.c) and fix the ChangeLog to include the
gcc.target/aarch64/adds1.c changes.

Thanks,
James

> 
> Thanks,
> Kyrill
> 
> 2015-07-10  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>
> 
>      * gcc.target/aarch64/adds3.c: Adjust for more aggressive
>      if-conversion..
>      * gcc.target/aarch64/ands_1.c: Likewise.
>      * gcc.target/aarch64/bics_1.c: Likewise.
>      * gcc.target/aarch64/subs1.c: Likewise.
>      * gcc.target/aarch64/subs3.c: Likewise.

> diff --git a/gcc/testsuite/gcc.target/aarch64/adds1.c 
> b/gcc/testsuite/gcc.target/aarch64/adds1.c
> index 6cc700a..1689029 100644
> --- a/gcc/testsuite/gcc.target/aarch64/adds1.c
> +++ b/gcc/testsuite/gcc.target/aarch64/adds1.c
> @@ -12,7 +12,7 @@ adds_si_test1 (int a, int b, int c)
>    if (d == 0)
>      return a + c;
>    else
> -    return b + d + c;
> +    return d;
>  }
>  
>  int
> @@ -24,7 +24,7 @@ adds_si_test2 (int a, int b, int c)
>    if (d == 0)
>      return a + c;
>    else
> -    return b + d + c;
> +    return d;
>  }
>  
>  int
> @@ -36,7 +36,7 @@ adds_si_test3 (int a, int b, int c)
>    if (d == 0)
>      return a + c;
>    else
> -    return b + d + c;
> +    return d;
>  }
>  
>  typedef long long s64;
> @@ -50,7 +50,7 @@ adds_di_test1 (s64 a, s64 b, s64 c)
>    if (d == 0)
>      return a + c;
>    else
> -    return b + d + c;
> +    return d;
>  }
>  
>  s64
> @@ -62,7 +62,7 @@ adds_di_test2 (s64 a, s64 b, s64 c)
>    if (d == 0)
>      return a + c;
>    else
> -    return b + d + c;
> +    return d;
>  }
>  
>  s64
> @@ -74,7 +74,7 @@ adds_di_test3 (s64 a, s64 b, s64 c)
>    if (d == 0)
>      return a + c;
>    else
> -    return b + d + c;
> +    return d;
>  }
>  
>  int main ()
> @@ -83,66 +83,68 @@ int main ()
>    s64 y;
>  
>    x = adds_si_test1 (29, 4, 5);
> -  if (x != 42)
> +  if (x != (29 + 4))
>      abort ();
>  
> -  x = adds_si_test1 (5, 2, 20);
> -  if (x != 29)
> +  x = adds_si_test1 (5, 2, -5);
> +  if (x != 7)
>      abort ();
>  
>    x = adds_si_test2 (29, 4, 5);
> -  if (x != 293)
> +  if (x != (29 + 0xff))
>      abort ();
>  
> -  x = adds_si_test2 (1024, 2, 20);
> -  if (x != 1301)
> +  x = adds_si_test2 (-255, 2, 20);
> +  if (x != -235)
>      abort ();
>  
>    x = adds_si_test3 (35, 4, 5);
> -  if (x != 76)
> +  if (x != (35 + (4 << 3)))
>      abort ();
>  
> -  x = adds_si_test3 (5, 2, 20);
> -  if (x != 43)
> +  x = adds_si_test3 (-(2 << 3), 2, 20);
> +  if (x != (20 - (2 << 3)))
>      abort ();
>  
>    y = adds_di_test1 (0x130000029ll,
>                    0x320000004ll,
>                    0x505050505ll);
>  
> -  if (y != 0xc75050536)
> +  if (y != (0x130000029ll + 0x320000004ll))
>      abort ();
>  
>    y = adds_di_test1 (0x5000500050005ll,
> -                  0x2111211121112ll,
> +                  -0x5000500050005ll,
>                    0x0000000002020ll);
> -  if (y != 0x9222922294249)
> +  if (y != (0x5000500050005ll + 0x0000000002020ll))
>      abort ();
>  
>    y = adds_di_test2 (0x130000029ll,
>                    0x320000004ll,
>                    0x505050505ll);
> -  if (y != 0x955050631)
> +  if (y != (0x130000029ll + 0xff))
>      abort ();
>  
> -  y = adds_di_test2 (0x130002900ll,
> +  y = adds_di_test2 (-0xff,
>                    0x320000004ll,
>                    0x505050505ll);
> -  if (y != 0x955052f08)
> +  if (y != (0x505050505ll - 0xff))
>      abort ();
>  
>    y = adds_di_test3 (0x130000029ll,
>                    0x064000008ll,
>                    0x505050505ll);
> -  if (y != 0x9b9050576)
> +  if (y != (0x130000029ll + (0x064000008ll << 3)))
>      abort ();
>  
>    y = adds_di_test3 (0x130002900ll,
> -                  0x088000008ll,
> +                  -(0x130002900ll >> 3),
>                    0x505050505ll);
> -  if (y != 0xafd052e4d)
> +  if (y != (0x130002900ll + 0x505050505ll))
>      abort ();


> +#if 0
>  
> +#endif

Drop this hunk.

>    return 0;
>  }
>  

Reply via email to