On Wed, May 08, 2019 at 06:09:06PM +0800, JunMa wrote:
> 2019-05-07  Jun Ma <ju...@linux.alibaba.com>
> 
>     PR tree-optimization/90106
>     * gcc.dg/cdce1.c: Check tailcall code generation after cdce pass.
>     * gcc.dg/cdce2.c: Likewise.

This is wrong and results in UNSUPPORTED failures.
Both tests are dg-do run, so you can't scan-assembler for them, assembly
isn't generated at all (it could be if -save-temps is in dg-options).
Furthermore, I don't any target actually spells the tailcall in the assembly
as jmp space pow/log, rather than say on x86_64/i686 jmp tab pow/log, but
on most other targets completely differently (and some targets don't support
tail calls at all, or have various limitations for them etc.).

One possibility is to add -fdump-tree-optimized and scan for
/* { dg-final { scan-tree-dump "pow \\(\[^\n\r]*\\); \\\[tail call\\\]" 
"optimized" } } */
resp.
/* { dg-final { scan-tree-dump "log \\(\[^\n\r]*\\); \\\[tail call\\\]" 
"optimized" } } */

> diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c
> index b23ad63..424d80f 100644
> --- a/gcc/testsuite/gcc.dg/cdce1.c
> +++ b/gcc/testsuite/gcc.dg/cdce1.c
> @@ -1,7 +1,8 @@
>  /* { dg-do  run  } */
>  /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details  -lm" } */
>  /* { dg-require-effective-target int32plus } */
> -/* { dg-final { scan-tree-dump  "cdce1.c:16: .* function call is 
> shrink-wrapped into error conditions\."  "cdce" } } */
> +/* { dg-final { scan-tree-dump  "cdce1.c:17: .* function call is 
> shrink-wrapped into error conditions\."  "cdce" } } */
> +/* { dg-final { scan-assembler     "jmp pow" } } */
>  /* { dg-require-effective-target large_double } */
>  
>  #include <stdlib.h>
> diff --git a/gcc/testsuite/gcc.dg/cdce2.c b/gcc/testsuite/gcc.dg/cdce2.c
> index 30e7cb1..2af2893 100644
> --- a/gcc/testsuite/gcc.dg/cdce2.c
> +++ b/gcc/testsuite/gcc.dg/cdce2.c
> @@ -1,7 +1,8 @@
>  /* { dg-do  run  } */
>  /* { dg-skip-if "doubles are floats" { "avr-*-*" } } */
>  /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details  -lm" } */
> -/* { dg-final { scan-tree-dump  "cdce2.c:15: .* function call is 
> shrink-wrapped into error conditions\." "cdce" } } */
> +/* { dg-final { scan-tree-dump  "cdce2.c:16: .* function call is 
> shrink-wrapped into error conditions\." "cdce" } } */
> +/* { dg-final { scan-assembler "jmp log" } } */
>   
>  #include <stdlib.h>
>  #include <math.h>

        Jakub

Reply via email to