public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [PR99708] [rs6000] don't expect __ibm128 with 64-bit long double
@ 2023-03-25  8:37 Alexandre Oliva
  2023-03-27  7:05 ` Kewen.Lin
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2023-03-25  8:37 UTC (permalink / raw)
  To: gcc-patches
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool, Kewen Lin


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.

Regstrapped on ppc64-linux-gnu.  Also tested with ppc64-vxworks7r2
(gcc-12).  Ok to install?


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 |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c b/gcc/testsuite/gcc.target/powerpc/pr99708.c
index 02b40ebc40d3d..fca6296d9c81f 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr99708.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -14,7 +14,13 @@
 int main (void)
 {
   if (__SIZEOF_FLOAT128__ != sizeof (__float128)
-      || __SIZEOF_IBM128__ != sizeof (__ibm128))
+#ifdef __SIZEOF_IBM128__ /* Not defined, and no __ibm128 type on targets whose
+			    long double is 64-bit.  */
+      || __SIZEOF_IBM128__ != sizeof (__ibm128)
+#else
+      || __SIZEOF_LONG_DOUBLE__ * __CHAR_BIT__ != 64
+#endif
+      )
     abort ();
 
   return 0;

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

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

end of thread, other threads:[~2023-04-15  2:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25  8:37 [PATCH] [PR99708] [rs6000] don't expect __ibm128 with 64-bit long double 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
2023-04-15  2:55           ` Alexandre Oliva

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).