public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Alexandre Oliva <oliva@adacore.com>
Cc: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	Mike Stump <mikestump@comcast.net>,
	David Edelsohn <dje.gcc@gmail.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Kewen Lin <linkw@gcc.gnu.org>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] [PR99708] [rs6000] don't expect __ibm128 with 64-bit long double
Date: Fri, 7 Apr 2023 17:49:05 +0800	[thread overview]
Message-ID: <c55c3823-437e-e6f2-029b-302e6e7e4ac8@linux.ibm.com> (raw)
In-Reply-To: <or1qkw8ntl.fsf@lxoliva.fsfla.org>

Hi Alexandre,

on 2023/4/7 09:48, Alexandre Oliva wrote:
> On Apr  6, 2023, "Kewen.Lin" <linkw@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	other threads:[~2023-04-07  9:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25  8:37 Alexandre Oliva
2023-03-27  7:05 ` Kewen.Lin
2023-04-06  4:43   ` Alexandre Oliva
2023-04-06  6:17     ` Kewen.Lin
2023-04-07  1:48       ` Alexandre Oliva
2023-04-07  9:49         ` Kewen.Lin [this message]
2023-04-15  2:55           ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c55c3823-437e-e6f2-029b-302e6e7e4ac8@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=oliva@adacore.com \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).