From patchwork Thu Apr 18 15:24:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 1087670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499445-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44lNGK1VNMz9s3Z for ; Fri, 19 Apr 2019 01:25:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=Ga55/ 6pqkqUCwzsYlBFnOpiKFUDshWi2WWNzkAsk7cl/GISiB6dFxwyCxo6YtzF3/RBS0 sRybNkmD7CupldSEYks1iluLh0xRfvWmqmO4nGrSacWqWDPQSQtgWfvCvp7Ut3/f T3snJ6de89ouAqOuBSBFtEEjrOFK/pr63ttXBA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=onAf5V6NHI2 LIqlvDsKgD3NFyA4=; b=RLYpgbNpFm7rAovXipJEbXuQhRIcd06bF0wp/KsBocM 1YRJZ9XTd5MhJgvVmAtbPL3TVKfxeKnyl4p0zv/KzVWHFSNQWa45G+hxxKPsWBnx OsIU03SGCOVi6U2mWmKrImbdmBCEuSNa2Wmy3nfWacERvcXLIWUDJeelmnCs6+eU = Received: (qmail 25549 invoked by alias); 18 Apr 2019 15:24:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25484 invoked by uid 89); 18 Apr 2019 15:24:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Apr 2019 15:24:52 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3IFOOlD076553 for ; Thu, 18 Apr 2019 11:24:48 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rxu42a6ah-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 18 Apr 2019 11:24:48 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Apr 2019 16:24:47 +0100 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 18 Apr 2019 16:24:44 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3IFOil114287070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Apr 2019 15:24:44 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E5798B206A; Thu, 18 Apr 2019 15:24:43 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9BFC1B2067; Thu, 18 Apr 2019 15:24:43 +0000 (GMT) Received: from otta.local (unknown [9.80.223.219]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 18 Apr 2019 15:24:43 +0000 (GMT) To: GCC Patches Cc: Vladimir N Makarov , Jeff Law From: Peter Bergner Subject: [PATCH][IRA] Fix PR87871: [9 Regression] testcases fail after r265398 on arm Date: Thu, 18 Apr 2019 10:24:43 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 x-cbid: 19041815-0072-0000-0000-0000041BD675 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010950; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01190896; UDB=6.00624086; IPR=6.00971692; MB=3.00026502; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-18 15:24:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041815-0073-0000-0000-00004BDFE7DE Message-Id: <97f08912-05ad-6f52-a122-bebae6ae9d2c@linux.ibm.com> X-IsSubscribed: yes PR87871 exposes a couple of problems. One problem fixed here is that IRA incorrectly adds a conflict in some cases where we have a simple register copy between a pseudo reg and a hard reg. This stopped us from assigning the pseudo reg to that hard reg which we wanted to do in the testsuite test case shown in the bugzilla. The bug is due to an oversight in my r264897 commit that added support for not adding conflicts for simple register copies. That code correctly didn't add a conflict to CONFLICT_HARD_REGS in make_object_dead(), but failed to do the same for TOTAL_CONFLICT_HARD_REGS. The patch below fixes that oversight. I have confirmed we now assign pseudo p116 to r0 in the ARM test case as well as a similar assignment issue on POWER. This passed bootstrap and regtesting with no regressions on powerpc64le-linux. Ok for mainline? Peter PR rtl-optimization/87871 * ira-lives.c (make_object_dead): Don't add conflicts to TOTAL_CONFLICT_HARD_REGS for register ignore_reg_for_conflicts. Index: gcc/ira-lives.c =================================================================== --- gcc/ira-lives.c (revision 270420) +++ gcc/ira-lives.c (working copy) @@ -163,7 +163,9 @@ static void make_object_dead (ira_object_t obj) { live_range_t lr; + int regno; int ignore_regno = -1; + int ignore_total_regno = -1; int end_regno = -1; sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (obj)); @@ -174,16 +176,14 @@ make_object_dead (ira_object_t obj) && REGNO (ignore_reg_for_conflicts) < FIRST_PSEUDO_REGISTER) { end_regno = END_REGNO (ignore_reg_for_conflicts); - int src_regno = ignore_regno = REGNO (ignore_reg_for_conflicts); + ignore_regno = ignore_total_regno = REGNO (ignore_reg_for_conflicts); - while (src_regno < end_regno) + for (regno = ignore_regno; regno < end_regno; regno++) { - if (TEST_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), src_regno)) - { - ignore_regno = end_regno = -1; - break; - } - src_regno++; + if (TEST_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno)) + ignore_regno = end_regno; + if (TEST_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno)) + ignore_total_regno = end_regno; } } @@ -192,8 +192,10 @@ make_object_dead (ira_object_t obj) /* If IGNORE_REG_FOR_CONFLICTS did not already conflict with OBJ, make sure it still doesn't. */ - for (; ignore_regno < end_regno; ignore_regno++) - CLEAR_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), ignore_regno); + for (regno = ignore_regno; regno < end_regno; regno++) + CLEAR_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno); + for (regno = ignore_total_regno; regno < end_regno; regno++) + CLEAR_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno); lr = OBJECT_LIVE_RANGES (obj); ira_assert (lr != NULL);