Hi Alexandre,

on 2023/4/7 09:48, Alexandre Oliva wrote:
> On Apr  6, 2023, "Kewen.Lin" <li...@linux.ibm.com> wrote:
> 
>> The reason why personally I preferred to fix it with xfail is that:
> 
> Got it.  I'm convinced, and I agree.
> 
> I tried an xfail in the initial dg-do, but that is no good for a compile
> error, so I went for a dg-bogus xfail.  I hope that will still have the
> intended effect when __ibm128 is defined when it currently isn't.
> 

Thanks for looking into it.

> There is a dg-skip-if in this test on the trunk, covering some targets,
> that IIRC are longdouble64, so maybe that's related and I could have
> dropped them, but I wasn't sure, so I left them alone.

I think it's due to that -mfloat128 isn't fully supported on them, so
yeah, just leave them alone.

> 
> Regstrapped on ppc64-linux-gnu (pass), also tested on ppc64-vx7r2/gcc-12
> (xfail).  Ok to install?
> 
> 
> [PR99708] [rs6000] don't expect __ibm128 with 64-bit long double
> 
> When long double is 64-bit wide, as on vxworks, the rs6000 backend
> defines neither the __ibm128 type nor the __SIZEOF_IBM128__ macro, but
> pr99708.c expected both to be always defined.  Adjust the test to
> match the implementation.
> 
> 
> for  gcc/testsuite/ChangeLog
> 
>       * gcc.target/powerpc/pr99708.c: Accept lack of
>       __SIZEOF_IBM128__ when long double is 64-bit wide.
> ---
>  gcc/testsuite/gcc.target/powerpc/pr99708.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c 
> b/gcc/testsuite/gcc.target/powerpc/pr99708.c
> index 02b40ebc40d3d..66a5f88479330 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr99708.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
> @@ -14,7 +14,7 @@
>  int main (void)
>  {
>    if (__SIZEOF_FLOAT128__ != sizeof (__float128)
> -      || __SIZEOF_IBM128__ != sizeof (__ibm128))
> +      || __SIZEOF_IBM128__ != sizeof (__ibm128)) /* { dg-bogus "undeclared" 
> "" { xfail longdouble64 } } */
>      abort ();
>  

This new version causes unresolved record on my side, it's due to the 
compilation failed to produce executable.

                === gcc Summary for unix/-m64 ===

# of expected passes            1
# of expected failures          1
# of unresolved testcases       1

So I think we need to make the file be compiled well, how about something like:

------

diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c 
b/gcc/testsuite/gcc.target/powerpc/pr99708.c
index 02b40ebc40d..c6aa0511b89 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr99708.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -14,9 +14,17 @@
 int main (void)
 {
   if (__SIZEOF_FLOAT128__ != sizeof (__float128)
-      || __SIZEOF_IBM128__ != sizeof (__ibm128))
+  /* FIXME: Once type __ibm128 gets supported with long-double-64,
+     we shouldn't need this conditional #ifdef and xfail.  */
+#ifdef __SIZEOF_IBM128__
+      || __SIZEOF_IBM128__ != sizeof (__ibm128)
+#else
+      || 1
+#endif
+     )
     abort ();

   return 0;
 }

+/* { dg-xfail-run-if "unsupported type __ibm128 with long-double-64" { 
longdouble64 } } */

------                                                                          
   

?  OK if it looks reasonable to you and the testing goes well.  Thanks!

BR,
Kewen

Reply via email to