From patchwork Sat Mar 18 00:12:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 71539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp52072wrt; Fri, 17 Mar 2023 17:13:16 -0700 (PDT) X-Google-Smtp-Source: AK7set9RfnpfhU5fcnh1FK9+UnfYGERZeBeu+sDH4D1+2lSVoOlIImEoQn5TtLGrv2JaMzFDFScC X-Received: by 2002:a17:906:4f86:b0:8eb:d3a5:b9f0 with SMTP id o6-20020a1709064f8600b008ebd3a5b9f0mr956325eju.67.1679098396126; Fri, 17 Mar 2023 17:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679098396; cv=none; d=google.com; s=arc-20160816; b=prTnTOXeZnep2ZL+DhLjBij5zoHoSEp9kMVgwF3YJY+B75eR31+m7HQ8SHW3DtvFzy QeYpj1PGD/BDUjd+jL0dLPbwe337JwPRG/htTBr1C/68iHUXrH8qmCPEh3gHyST8SrrC PKOS0lr/rheBwxTpH0kPOTGM36eBwOHRBN+cP158Pee76hlaC44kU1AdJ0Uc/PnkbK/Y R6nKCaWW6QIyTc9zkrRXQpMf08AGga+K5qTgsAp4Cpd+0JkSwLNoH/qETX0+iVcX3emC ohf3sodleuFBrzeiyXFSMF7WxhVaV5Uw3h2PN1JzeV9DBVDfULVYFTy7mRzGSFlVDSTC Qbdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:cc:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=FjEMiiSJ9+WpRg87BpLrUGeNbbj5/C8RcR69lJgB0YQ=; b=p+m3jJ01lgRIQssCuhB3Vi+GM4vDJrkD5QRXPlQP4IpYH8PePcL0SJbiUdFOBUbt3p bqXr60UoY0h1IAeUuauoiDmP4RyERG6K3eBC5/IGdaR4Nc9HKB5fztl8GkLSkpCYeZ3J d2QM6ltx2yfC6ZXnbtPMrYHeM0rWR3geUDCzDvrvnhD1xfFGz7n4+HBGRj7edq0KArFe 4LZKgdfkQ36SwkseQFZg8x2SPbIs5ZHjcS8FEE2JNoHahDn6vdVa5gdUaPG5ho8zO7ap 83O6ihYxKZx0SGDb7UAvKjGy+VD1c8Q1aIqhS/wkwHVhInSR9JuAlQKvY26lMnGVV5+u Exhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=R+n3ak31; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id gx10-20020a170906f1ca00b008cc93fd1626si3556362ejb.954.2023.03.17.17.13.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Mar 2023 17:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=R+n3ak31; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 20B17385086B for ; Sat, 18 Mar 2023 00:13:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20B17385086B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679098395; bh=FjEMiiSJ9+WpRg87BpLrUGeNbbj5/C8RcR69lJgB0YQ=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=R+n3ak31OPg8dMWpwJRBjZf1DOsw/v13BvP9Uudqo3D6a5YFPpbyyzTRUdfCqnGFp 3P5Qis+cqeMOoVRDiyg9svS1L10gFsM3S7NqLIyhkwkYNhyvH4cjYw3u987NwjQ5hG Gy3GnQy4fKmqufRfN8b4m8hzF6TU0vMbKGzwYqfE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 53C043858C50 for ; Sat, 18 Mar 2023 00:12:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 53C043858C50 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32HNVhRN001581 for ; Sat, 18 Mar 2023 00:12:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pd1y70mm7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 18 Mar 2023 00:12:27 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32I005l1020512 for ; Sat, 18 Mar 2023 00:12:27 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pd1y70mm3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Mar 2023 00:12:27 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32HLOUSK007338; Sat, 18 Mar 2023 00:12:26 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([9.208.130.102]) by ppma02wdc.us.ibm.com (PPS) with ESMTPS id 3pbsnq36dg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Mar 2023 00:12:26 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32I0CPY929294896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 Mar 2023 00:12:25 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96DC458051; Sat, 18 Mar 2023 00:12:25 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DC555805A; Sat, 18 Mar 2023 00:12:25 +0000 (GMT) Received: from [9.211.90.110] (unknown [9.211.90.110]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Sat, 18 Mar 2023 00:12:25 +0000 (GMT) Message-ID: Date: Fri, 17 Mar 2023 19:12:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-US To: GCC Patches Cc: Vladimir N Makarov , Jakub Jelinek Subject: [committed] lra: Ignore debug insns and notes in combine_reload_insn [PR109179] X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: e1OfwEWdZwfzFKhf4BiWBQ-klv3-M-wa X-Proofpoint-GUID: YyrMymAAe_1YS_Nsf_0Xh80WPQUoHoDT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-17_17,2023-03-16_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 bulkscore=0 mlxlogscore=992 lowpriorityscore=0 malwarescore=0 mlxscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303170174 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Peter Bergner via Gcc-patches From: Peter Bergner Reply-To: Peter Bergner Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760662279446124083?= X-GMAIL-MSGID: =?utf-8?q?1760662279446124083?= We ICE in combine_reload_insn if we've deleted the TO insn operand during processing, because lra_get_insn_recog_data doesn't expect to see the note that replaces the deleted insn. The solution here is to exit early if TO is a debug insn or note. This caused a bootstrap issue on powerpc64le-linux. The fix was approved by Vlad. Committed and pushed after bootstrap testing and checking there were no testsuite regressions when compared to the commit before the commit that caused the ICE. Peter gcc/ PR rtl-optimization/109179 * lra-constraints.cc (combine_reload_insn): Enforce TO is not a debug insn or note. Move the tests earlier to guard lra_get_insn_recog_data. diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc index 95b534e1a70..405b8b92f5e 100644 --- a/gcc/lra-constraints.cc +++ b/gcc/lra-constraints.cc @@ -5014,14 +5014,19 @@ combine_reload_insn (rtx_insn *from, rtx_insn *to) enum reg_class to_class, from_class; int n, nop; signed char changed_nops[MAX_RECOG_OPERANDS + 1]; - lra_insn_recog_data_t id = lra_get_insn_recog_data (to); - struct lra_static_insn_data *static_id = id->insn_static_data; /* Check conditions for second memory reload and original insn: */ if ((targetm.secondary_memory_needed == hook_bool_mode_reg_class_t_reg_class_t_false) - || NEXT_INSN (from) != to || CALL_P (to) - || id->used_insn_alternative == LRA_UNKNOWN_ALT + || NEXT_INSN (from) != to + || !NONDEBUG_INSN_P (to) + || CALL_P (to)) + return false; + + lra_insn_recog_data_t id = lra_get_insn_recog_data (to); + struct lra_static_insn_data *static_id = id->insn_static_data; + + if (id->used_insn_alternative == LRA_UNKNOWN_ALT || (set = single_set (from)) == NULL_RTX) return false; from_reg = SET_DEST (set);