From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id A98BE3871015 for ; Tue, 22 Dec 2020 08:05:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A98BE3871015 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BM81BVq100968; Tue, 22 Dec 2020 03:05:47 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 35kct10anj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Dec 2020 03:05:47 -0500 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0BM81Cfx101081; Tue, 22 Dec 2020 03:05:47 -0500 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 35kct10amw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Dec 2020 03:05:46 -0500 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BM833tO031489; Tue, 22 Dec 2020 08:05:45 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03fra.de.ibm.com with ESMTP id 35ja5rrt9f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Dec 2020 08:05:44 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BM85f7c26345930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Dec 2020 08:05:41 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 706D0AE04D; Tue, 22 Dec 2020 08:05:42 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA6AAAE057; Tue, 22 Dec 2020 08:05:40 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.200.35.181]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 Dec 2020 08:05:40 +0000 (GMT) To: GCC Patches Cc: Vladimir Makarov , Segher Boessenkool , Bill Schmidt From: "Kewen.Lin" Subject: [PATCH] ira: Skip some pseudos in move_unallocated_pseudos Message-ID: <6e1b52f1-a038-9725-38af-5e3007023718@linux.ibm.com> Date: Tue, 22 Dec 2020 16:05:39 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3BBDBD30F9AA9462091A9870" Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-22_02:2020-12-21, 2020-12-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 mlxscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012220056 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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: Tue, 22 Dec 2020 08:05:50 -0000 This is a multi-part message in MIME format. --------------3BBDBD30F9AA9462091A9870 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Hi, This patch is to make move_unallocated_pseudos consistent to what we have in function find_moveable_pseudos, where we record the original pseudo into pseudo_replaced_reg only if validate_change succeeds with newreg. To ensure every unallocated pseudo in move_unallocated_pseudos has expected information, it's better to add a check and skip it if it's unexpected. This avoids possible ICEs in future. btw, I happened to found this in the bootstrapping for one experimental local patch, which is considered as impractical. Bootstrapped/regtested on powerpc64le-linux-gnu P9. BR, Kewen gcc/ChangeLog: * ira.c (move_unallocated_pseudos): Check other_reg and skip if it isn't set. --------------3BBDBD30F9AA9462091A9870 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="ira.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ira.diff" diff --git a/gcc/ira.c b/gcc/ira.c index 89b5df4003d..472fcf52aad 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -5111,6 +5111,11 @@ move_unallocated_pseudos (void) { int idx = i - first_moveable_pseudo; rtx other_reg = pseudo_replaced_reg[idx]; + /* If there is no appropriate pseudo in pseudo_replaced_reg, it + means validate_change fails for this new pseudo in function + find_moveable_pseudos, then bypass it here.*/ + if (!other_reg) + continue; rtx_insn *def_insn = DF_REF_INSN (DF_REG_DEF_CHAIN (i)); /* The use must follow all definitions of OTHER_REG, so we can insert the new definition immediately after any of them. */ --------------3BBDBD30F9AA9462091A9870--