public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix PR middle-end/98099
@ 2020-12-03 10:47 Eric Botcazou
  2020-12-03 12:33 ` Richard Biener
  2021-03-18  8:57 ` [committed] testsuite: Fix up pr98099.c testcase for big endian [PR98099] Jakub Jelinek
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Botcazou @ 2020-12-03 10:47 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

Hi,

this replaces the ICE by a sorry message for the use of reverse scalar storage 
order with a 128-bit decimal floating-point type on 32-bit platforms.

Tested on x86-64/Linux, OK for the mainline?


2020-12-03  Eric Botcazou  <ebotcazou@adacore.com>

	* expmed.c (flip_storage_order): In the case of a non-integer mode,
	sorry out if the integer mode to be used instead is not supported.


2020-12-03  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/pr98099.c: New test.

-- 
Eric Botcazou

[-- Attachment #2: pr98099.c --]
[-- Type: text/x-csrc, Size: 319 bytes --]

/* PR middle-end/98099 */
/* Reported by G. Steinmetz <gscfq@t-online.de> */

/* { dg-do compile } */
/* { dg-options "-fsso-struct=big-endian" } */

struct S { _Decimal128 a; };

_Decimal128 f (struct S x)
{
  return x.a; /* { dg-message "sorry, unimplemented: reverse storage order" "" { target { ! int128 } } } */
}

[-- Attachment #3: pr98099.diff --]
[-- Type: text/x-patch, Size: 606 bytes --]

diff --git a/gcc/expmed.c b/gcc/expmed.c
index ce88f322961..0d600bd7b54 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -412,7 +412,8 @@ flip_storage_order (machine_mode mode, rtx x)
 	  && __builtin_expect (reverse_float_storage_order_supported < 0, 0))
 	check_reverse_float_storage_order_support ();
 
-      if (!int_mode_for_size (GET_MODE_PRECISION (mode), 0).exists (&int_mode))
+      if (!int_mode_for_size (GET_MODE_PRECISION (mode), 0).exists (&int_mode)
+	  || !targetm.scalar_mode_supported_p (int_mode))
 	{
 	  sorry ("reverse storage order for %smode", GET_MODE_NAME (mode));
 	  return x;

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

end of thread, other threads:[~2021-03-19 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 10:47 [patch] Fix PR middle-end/98099 Eric Botcazou
2020-12-03 12:33 ` Richard Biener
2020-12-04  9:22   ` Christophe Lyon
2020-12-04  9:29     ` Eric Botcazou
2021-03-18  8:57 ` [committed] testsuite: Fix up pr98099.c testcase for big endian [PR98099] Jakub Jelinek

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