public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] s390: Fix bootstrap error with checking and -m31
@ 2022-10-19  6:22 Robin Dapp
  2022-10-19  6:24 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Dapp @ 2022-10-19  6:22 UTC (permalink / raw)
  To: GCC Patches, Andreas Krebbel

Hi,

since r13-2746 we hit an ICE when bootstrapping with -m31 and
--enable-checking=all.

../../../../libgfortran/ieee/ieee_helper.c: In function
'ieee_class_helper_16':
../../../../libgfortran/ieee/ieee_helper.c:77:3: internal compiler
error: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at
rtl.h:1932
   77 |   }
      |   ^
../../../../libgfortran/ieee/ieee_helper.c:87:1: note: in expansion of
macro 'CLASSMACRO'
   87 | CLASSMACRO(16)
      | ^~~~~~~~~~

This patch fixes the problem by first checking for reload_completed
and also ensuring that REGNO is only called on reg operands rather
than subregs.

Bootstrapped and regtested --with-arch=arch14 and --enable-checking=all.

Is it OK?

Regards
 Robin

--

gcc/ChangeLog:

	* config/s390/s390.md: Move reload_completed and check operands for REG_P.

---
 gcc/config/s390/s390.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 962927c31126..c89b15cf4f3c 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -8797,9 +8797,10 @@ (define_split
         (neg:DI (match_operand:DI 1 "register_operand" "")))
    (clobber (reg:CC CC_REGNUM))]
   "!TARGET_ZARCH
-   && (REGNO (operands[0]) == REGNO (operands[1])
-      || s390_split_ok_p (operands[0], operands[1], DImode, 0))
-   && reload_completed"
+   && reload_completed
+   && ((REG_P (operands[0]) && REG_P (operands[1])
+       && REGNO (operands[0]) == REGNO (operands[1]))
+      || s390_split_ok_p (operands[0], operands[1], DImode, 0))"
   [(parallel
     [(set (match_dup 2) (neg:SI (match_dup 3)))
      (clobber (reg:CC CC_REGNUM))])
-- 
2.31.1

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

* Re: [PATCH] s390: Fix bootstrap error with checking and -m31
  2022-10-19  6:22 [PATCH] s390: Fix bootstrap error with checking and -m31 Robin Dapp
@ 2022-10-19  6:24 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2022-10-19  6:24 UTC (permalink / raw)
  To: Robin Dapp, GCC Patches

On 10/19/22 08:22, Robin Dapp wrote:
> Hi,
> 
> since r13-2746 we hit an ICE when bootstrapping with -m31 and
> --enable-checking=all.
> 
> ../../../../libgfortran/ieee/ieee_helper.c: In function
> 'ieee_class_helper_16':
> ../../../../libgfortran/ieee/ieee_helper.c:77:3: internal compiler
> error: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at
> rtl.h:1932
>    77 |   }
>       |   ^
> ../../../../libgfortran/ieee/ieee_helper.c:87:1: note: in expansion of
> macro 'CLASSMACRO'
>    87 | CLASSMACRO(16)
>       | ^~~~~~~~~~
> 
> This patch fixes the problem by first checking for reload_completed
> and also ensuring that REGNO is only called on reg operands rather
> than subregs.
> 
> Bootstrapped and regtested --with-arch=arch14 and --enable-checking=all.
> 
> Is it OK?
Ok. Thanks!

Andreas


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

end of thread, other threads:[~2022-10-19  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19  6:22 [PATCH] s390: Fix bootstrap error with checking and -m31 Robin Dapp
2022-10-19  6:24 ` Andreas Krebbel

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