public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Fix up forwprop-39.c testcase [PR109145]
@ 2023-03-17  8:17 Jakub Jelinek
  2023-03-17  9:00 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2023-03-17  8:17 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

As written in the PR, newlib headers aren't C11 compliant in that they
don't define CMPLXF macro, and glibc before 2.16 doesn't define that
either.  I think it is easier to use __builtin_complex directly, over
another patch which keeps including complex.h but defines CMPLXF if it
isn't defined, we want to test how forwprop behaves rather than what
complex.h defines or doesn't define.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2023-03-17  Jakub Jelinek  <jakub@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" } } */

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: Fix up forwprop-39.c testcase [PR109145]
  2023-03-17  8:17 [PATCH] testsuite: Fix up forwprop-39.c testcase [PR109145] Jakub Jelinek
@ 2023-03-17  9:00 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-03-17  9:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Fri, 17 Mar 2023, Jakub Jelinek wrote:

> Hi!
> 
> As written in the PR, newlib headers aren't C11 compliant in that they
> don't define CMPLXF macro, and glibc before 2.16 doesn't define that
> either.  I think it is easier to use __builtin_complex directly, over
> another patch which keeps including complex.h but defines CMPLXF if it
> isn't defined, we want to test how forwprop behaves rather than what
> complex.h defines or doesn't define.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

> 2023-03-17  Jakub Jelinek  <jakub@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" } } */
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-17  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17  8:17 [PATCH] testsuite: Fix up forwprop-39.c testcase [PR109145] Jakub Jelinek
2023-03-17  9:00 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).