From patchwork Fri Jul 21 10:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surya Kumari Jangala X-Patchwork-Id: 123734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp100282vqg; Fri, 21 Jul 2023 03:14:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlEDM8OzJiWUC8yz1ZDkZBWtBACKKgyHQlRMTydrn3OSurC6pDDhA8jsgJA2jOlbwmExD6je X-Received: by 2002:a17:906:7a13:b0:993:eddd:6df9 with SMTP id d19-20020a1709067a1300b00993eddd6df9mr1269226ejo.2.1689934483526; Fri, 21 Jul 2023 03:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689934483; cv=none; d=google.com; s=arc-20160816; b=MhT/jMclI2YDR8IPYi+hZ4eKIz4wMJNm6F9tlHvtiUkszv2Cp0GuLke9zfczMw600S 9kEvzy35FyH8zPgZ8l4FSol19VC01odAzHtq7TtnTYGvZJyKvLm46vI74z9CtwiQZ0hA 9R4+vIy6JJIJQDD8ihCYoz3hY6z3nuoGOus9x9N2pDFKMtx4/akSclcxw1ZMzqaX9WSQ cDzW15MzbTpO9gkimZRyOXK62iyCfeHhmuu7vh1gB90HXJCpy47WVRLIGP7RFR3hAapA O0H7Qkbc87d2zzMh1mc1jpNV9tZUZyz37/ajoiIcmTwS5pmsX3si7uHZdb2dqEoH2xR7 2laA== 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=QAAu26RnWEWkWfFgDw0+UUlBc6w1RAwho0Z6PAKahx8=; fh=NKUcUYA8CvII94+qgDnjxHPXcirdD4qVEBmqh54+ePQ=; b=bTcRjjvllmzhJgqQFJlZ6pWXctKsUhdJ0PZdVzWzVRf2Ewp7yKlcVLGB1NHFp4D3kw 17uX9RnJK8TDxXHIuJMo3j/silUFSk/8fI5mJ/SzxeoKJrMCOAaijnhimupObLZt3I1s fCebiC0eQ6iVXJMFOjhTDZFmUfIA5Br8kzNUZ9OylAdncb4KzP/AqQ2xDv3x9FWIMM0S Rugsowb64LqxKI27BfDfThuRjA5YnAwHXCJN2Dd4AAiTMBeTmdFJ0BGGSNeZVp8T4XOY AOn/ZfCbHQJwGmyaQ1VHJyHa6iHg4xKAk6Vm7Zqfba4/kV7dIhwE/m4kRcfjGXEhMSmQ 0QUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JsUxnLyt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id i16-20020a1709061cd000b00992d122db36si1963368ejh.245.2023.07.21.03.14.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 03:14:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JsUxnLyt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 46076385C6D5 for ; Fri, 21 Jul 2023 10:14:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46076385C6D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689934482; bh=QAAu26RnWEWkWfFgDw0+UUlBc6w1RAwho0Z6PAKahx8=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=JsUxnLytlJX73oMlqwrWFeprCzzWQBj9VGA+2o1C8FdyqTmv3yZmer+3+5d/hDnlk yAwe6kuZ63N6p+XNRsCELYj6uo96u+qQKTrWW4PS8mNsWx87+bsKxxyDlOzJO5s1g4 aCD9dXGPMrb278baqilSL+rwAJciNxEhexmFwPNI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 26A983858D35 for ; Fri, 21 Jul 2023 10:13:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26A983858D35 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36L9asD3019783 for ; Fri, 21 Jul 2023 10:13:57 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ryc7g7t00-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Jul 2023 10:13:56 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36LA4Odj032527 for ; Fri, 21 Jul 2023 10:13:56 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ryc7g7syr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 10:13:56 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36L95SJH004179; Fri, 21 Jul 2023 10:13:55 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3rv8g1ecrp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 10:13:55 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36LADshm36110640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jul 2023 10:13:54 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8C2B58056; Fri, 21 Jul 2023 10:13:54 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5287558052; Fri, 21 Jul 2023 10:13:53 +0000 (GMT) Received: from [9.109.195.200] (unknown [9.109.195.200]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jul 2023 10:13:53 +0000 (GMT) Message-ID: <202aea78-0a16-c78b-206c-824ba7bab65d@linux.vnet.ibm.com> Date: Fri, 21 Jul 2023 15:43:51 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: GCC Patches Cc: vmakarov@redhat.com, Peter Bergner Subject: [PATCH] ira: update allocated_hardreg_p[] in improve_allocation() [PR110254] X-TM-AS-GCONF: 00 X-Proofpoint-GUID: YKYa1nii6jBG2RP38IWppYO4PSFmrgHI X-Proofpoint-ORIG-GUID: tlyN5Cwenu-zJsuB5yyuw8cuWGVxeNle X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_06,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=821 malwarescore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 clxscore=1011 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307210090 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: Surya Kumari Jangala via Gcc-patches From: Surya Kumari Jangala Reply-To: Surya Kumari Jangala Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772024741304952462 X-GMAIL-MSGID: 1772024741304952462 The improve_allocation() routine does not update the allocated_hardreg_p[] array after an allocno is assigned a register. If the register chosen in improve_allocation() is one that already has been assigned to a conflicting allocno, then allocated_hardreg_p[] already has the corresponding bit set to TRUE, so nothing needs to be done. But improve_allocation() can also choose a register that has not been assigned to a conflicting allocno, and also has not been assigned to any other allocno. In this case, allocated_hardreg_p[] has to be updated. 2023-07-21 Surya Kumari Jangala gcc/ PR rtl-optimization/PR110254 * ira-color.cc (improve_allocation): Update array diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc index 1fb2958bddd..5807d6d26f6 100644 --- a/gcc/ira-color.cc +++ b/gcc/ira-color.cc @@ -3340,6 +3340,10 @@ improve_allocation (void) } /* Assign the best chosen hard register to A. */ ALLOCNO_HARD_REGNO (a) = best; + + for (j = nregs - 1; j >= 0; j--) + allocated_hardreg_p[best + j] = true; + if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL) fprintf (ira_dump_file, "Assigning %d to a%dr%d\n", best, ALLOCNO_NUM (a), ALLOCNO_REGNO (a));