]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390: Fix bootstrap error with checking and -m31.
authorRobin Dapp <rdapp@linux.ibm.com>
Tue, 18 Oct 2022 10:27:37 +0000 (12:27 +0200)
committerRobin Dapp <rdapp@linux.ibm.com>
Wed, 19 Oct 2022 11:00:07 +0000 (13:00 +0200)
For a while already 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.

gcc/ChangeLog:

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

gcc/config/s390/s390.md

index 962927c31126b3dfade6a9314bb54e24f1df5ead..c89b15cf4f3c8b115405bc69bd7e9f8d8f9cddf6 100644 (file)
         (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))])