From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 65DFB386180E for ; Wed, 23 Jun 2021 11:33:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65DFB386180E Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15NBXLw7131611 for ; Wed, 23 Jun 2021 07:33:53 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 39c3kp93du-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Jun 2021 07:33:52 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15NBHVHM015168 for ; Wed, 23 Jun 2021 11:33:51 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06ams.nl.ibm.com with ESMTP id 3997uh9x8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Jun 2021 11:33:51 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15NBXmCj30867754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 23 Jun 2021 11:33:48 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B44EF5204E for ; Wed, 23 Jun 2021 11:33:48 +0000 (GMT) Received: from li-926bd7cc-2dd1-11b2-a85c-f6adc0f5efec.ibm.com (unknown [9.171.6.251]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 922C55205F for ; Wed, 23 Jun 2021 11:33:48 +0000 (GMT) From: Robin Dapp Subject: [PATCH] combine: Check for paradoxical subreg To: GCC Patches Message-ID: <23c7868a-6736-5c73-fa9a-05e3e5ef53d6@linux.ibm.com> Date: Wed, 23 Jun 2021 13:33:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3522B53AA4E39447B0EC316C" Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-GUID: wqgtCIRmsB7qCeHaIvtoYwo6zae-wlYr X-Proofpoint-ORIG-GUID: wqgtCIRmsB7qCeHaIvtoYwo6zae-wlYr X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-23_06:2021-06-23, 2021-06-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106230066 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_L3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2021 11:33:54 -0000 This is a multi-part message in MIME format. --------------3522B53AA4E39447B0EC316C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, while evaluating another patch that introduces more lvalue paradoxical subregs I ran into an ICE in combine at wide_int o = wi::insert (rtx_mode_t (outer, temp_mode), rtx_mode_t (inner, dest_mode), offset, width); because width (=GET_MODE_PRECISION (dest_mode)) > GET_MODE_PRECISION (temp_mode). From the comments and the code it looks like we do not want to handle a paradoxical subreg here so I quickly added a check for it which prevents the ICE. The check could also be added to reg_subword_p () I guess. Is this the right thing to do or am I missing something, i.e. my other patch might be doing something it should not? Bootstrap on s390x was successful and testsuite is looking good so far. Regards Robin -- gcc/ChangeLog: * combine.c (try_combine): Check for paradoxical subreg. --------------3522B53AA4E39447B0EC316C Content-Type: text/x-patch; charset=UTF-8; name="0011-combine-paradoxical-subreg-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0011-combine-paradoxical-subreg-fix.patch" >From 2b74c66f8d97c30c45e99336c9871cccd8cf94e1 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue, 22 Jun 2021 17:35:37 +0200 Subject: [PATCH 11/11] combine paradoxical subreg fix. --- gcc/combine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/combine.c b/gcc/combine.c index 6476812a212..de04560db21 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2782,7 +2782,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, && CONST_SCALAR_INT_P (SET_SRC (temp_expr)) && GET_CODE (PATTERN (i3)) == SET && CONST_SCALAR_INT_P (SET_SRC (PATTERN (i3))) - && reg_subword_p (SET_DEST (PATTERN (i3)), SET_DEST (temp_expr))) + && reg_subword_p (SET_DEST (PATTERN (i3)), SET_DEST (temp_expr)) + && !paradoxical_subreg_p (SET_DEST (PATTERN (i3)))) { rtx dest = SET_DEST (PATTERN (i3)); rtx temp_dest = SET_DEST (temp_expr); -- 2.31.1 --------------3522B53AA4E39447B0EC316C--