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

* Re: [patch] Fix PR middle-end/98099
  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
  2021-03-18  8:57 ` [committed] testsuite: Fix up pr98099.c testcase for big endian [PR98099] Jakub Jelinek
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Biener @ 2020-12-03 12:33 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: GCC Patches

On Thu, Dec 3, 2020 at 11:49 AM Eric Botcazou <botcazou@adacore.com> wrote:
>
> 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?

OK.

Richard.

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

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

* Re: [patch] Fix PR middle-end/98099
  2020-12-03 12:33 ` Richard Biener
@ 2020-12-04  9:22   ` Christophe Lyon
  2020-12-04  9:29     ` Eric Botcazou
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe Lyon @ 2020-12-04  9:22 UTC (permalink / raw)
  To: Richard Biener; +Cc: Eric Botcazou, GCC Patches

On Thu, 3 Dec 2020 at 13:33, Richard Biener via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Thu, Dec 3, 2020 at 11:49 AM Eric Botcazou <botcazou@adacore.com> wrote:
> >
> > 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?
>
> OK.
>
> Richard.
>
> >
> > 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.
> >

I think you need to add an effective-target check, because the new test
fails on aarch64/arm:
FAIL: gcc.dg/pr98099.c (test for excess errors)
Excess errors:
/gcc/testsuite/gcc.dg/pr98099.c:7:12: error: decimal floating-point
not supported for this target
/gcc/testsuite/gcc.dg/pr98099.c:9:1: error: decimal floating-point not
supported for this target


Christophe

> > --
> > Eric Botcazou

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

* Re: [patch] Fix PR middle-end/98099
  2020-12-04  9:22   ` Christophe Lyon
@ 2020-12-04  9:29     ` Eric Botcazou
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Botcazou @ 2020-12-04  9:29 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: Richard Biener, GCC Patches

> I think you need to add an effective-target check, because the new test
> fails on aarch64/arm:

Done.

-- 
Eric Botcazou



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

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

On Thu, Dec 03, 2020 at 11:47:26AM +0100, Eric Botcazou wrote:
> 2020-12-03  Eric Botcazou  <ebotcazou@adacore.com>
> 
> 	* gcc.dg/pr98099.c: New test.

The testcase fails on big-endian without int128 support, because
due to -fsso-struct=big-endian no swapping is needed for big endian.
This patch restricts the testcase to big or little endian (but not pdp)
and uses -fsso-struct=little-endian for big endian, so that it is
swapping everywhere.

Regtested on x86_64-linux, i686-linux and cross tested on powerpc64-linux
-m32/-m64, acked by Eric in the PR, committed to trunk.

2021-03-18  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/98099
	* gcc.dg/pr98099.c: Don't compile the test on pdp endian.
	For big endian use -fsso-struct=little-endian dg-options.

--- gcc/testsuite/gcc.dg/pr98099.c.jj	2020-12-04 10:53:56.306043973 +0100
+++ gcc/testsuite/gcc.dg/pr98099.c	2021-03-17 20:05:07.714417723 +0100
@@ -1,8 +1,9 @@
 /* PR middle-end/98099 */
 /* Reported by G. Steinmetz <gscfq@t-online.de> */
 
-/* { dg-do compile { target dfp } } */
-/* { dg-options "-fsso-struct=big-endian" } */
+/* { dg-do compile { target { dfp && { be || le } } } } */
+/* { dg-options "-fsso-struct=big-endian" { target le } } */
+/* { dg-options "-fsso-struct=little-endian" { target be } } */
 
 struct S { _Decimal128 a; };
 


	Jakub


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