From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2017) id BE2B33858D39; Wed, 19 Oct 2022 11:00:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE2B33858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666177239; bh=znZv+yW+4lO00IZbBj3qk5Ca+ywqu8c0ORO2qnx0lsc=; h=From:To:Subject:Date:From; b=py4sLe36hf27IzB28xjTsMCiNMUu8yphY0ngJIVTvWn7qhIY3r+HEyPGaZJXewS1K WhBPMXb1kcLlaU3hlLCMUGu4RbxyVpDDsPMkQnlD948v08UBOsDgLQJ8Ef1GSe3CY3 Vs35rY+M6VYAZW8E5LXDkouj3NIyFpj493jemdng= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Robin Dapp To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3375] s390: Fix bootstrap error with checking and -m31. X-Act-Checkin: gcc X-Git-Author: Robin Dapp X-Git-Refname: refs/heads/master X-Git-Oldrev: 65b98fc763d14d371fcf37a17e33519012ec2bac X-Git-Newrev: 95c5cffb712d90bfe36f2cf71d3a052b8068db34 Message-Id: <20221019110039.BE2B33858D39@sourceware.org> Date: Wed, 19 Oct 2022 11:00:39 +0000 (GMT) List-Id: https://gcc.gnu.org/g:95c5cffb712d90bfe36f2cf71d3a052b8068db34 commit r13-3375-g95c5cffb712d90bfe36f2cf71d3a052b8068db34 Author: Robin Dapp Date: Tue Oct 18 12:27:37 2022 +0200 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. Diff: --- 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 962927c3112..c89b15cf4f3 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -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))])