s390: Fix bootstrap error with checking and -m31.

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.
This commit is contained in:
Robin Dapp 2022-10-18 12:27:37 +02:00
parent 65b98fc763
commit 95c5cffb71

View file

@ -8797,9 +8797,10 @@
(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))])