https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109145

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> So, I think we can either use:
> 2023-03-16  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR testsuite/109145
>       * gcc.dg/tree-ssa/forwprop-39.c (CMPLXF): Define if not defined.
> 
> --- gcc/testsuite/gcc.dg/tree-ssa/forwprop-39.c.jj    2023-03-13
> 10:18:59.545433477 +0100
> +++ gcc/testsuite/gcc.dg/tree-ssa/forwprop-39.c       2023-03-16
> 18:48:04.408908088 +0100
> @@ -3,6 +3,10 @@
>  
>  #include <complex.h>
>  
> +#ifndef CMPLXF
> +#define CMPLXF(x, y) __builtin_complex (x, y)
> +#endif
> +
>  extern void push1(void *p, float _Complex x);
>  void foo (void *q, float _Complex *x)
>  {
> or
> 2023-03-16  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR testsuite/109145
>       * gcc.dg/tree-ssa/forwprop-39.c: Don't include complex.h.
>       (foo): Use __builtin_complex rather than CMPLXF.
> 
> --- gcc/testsuite/gcc.dg/tree-ssa/forwprop-39.c.jj    2023-03-13
> 10:18:59.545433477 +0100
> +++ gcc/testsuite/gcc.dg/tree-ssa/forwprop-39.c       2023-03-16
> 18:49:40.563504504 +0100
> @@ -1,14 +1,12 @@
>  /* { dg-do compile } */
>  /* { dg-options "-std=c11 -O2 -fdump-tree-forwprop1 -fdump-tree-optimized"
> } */
>  
> -#include <complex.h>
> -
>  extern void push1(void *p, float _Complex x);
>  void foo (void *q, float _Complex *x)
>  {
>    float r = __real *x;
>    float i = __imag *x;
> -  push1 (q, CMPLXF (r, i));
> +  push1 (q, __builtin_complex (r, i));
>  }
>  
>  /* { dg-final { scan-tree-dump-not "COMPLEX_EXPR" "forwprop1" } } */
> 
> I think my preference would be the latter...

Yes, can you push that please?  Then also the -std=c11 is no longer necessary.

Reply via email to