From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13260 invoked by alias); 5 Aug 2019 20:37:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13251 invoked by uid 89); 5 Aug 2019 20:37:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:OUTLOOK, H*MI:PROD, H*c:HHH X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-oln040092070014.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.92.70.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Aug 2019 20:37:35 +0000 Received: from AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com (10.152.16.57) by AM5EUR03HT047.eop-EUR03.prod.protection.outlook.com (10.152.17.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18; Mon, 5 Aug 2019 20:37:27 +0000 Received: from VI1PR10MB2573.EURPRD10.PROD.OUTLOOK.COM (10.152.16.58) by AM5EUR03FT003.mail.protection.outlook.com (10.152.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Mon, 5 Aug 2019 20:37:27 +0000 Received: from VI1PR10MB2573.EURPRD10.PROD.OUTLOOK.COM ([fe80::cd4d:f59f:981a:54d6]) by VI1PR10MB2573.EURPRD10.PROD.OUTLOOK.COM ([fe80::cd4d:f59f:981a:54d6%5]) with mapi id 15.20.2136.018; Mon, 5 Aug 2019 20:37:27 +0000 From: Bernd Edlinger To: "gcc-patches@gcc.gnu.org" CC: Vladimir Makarov Subject: [PATCH] [LRA] Fix wrong-code PR 91109 Date: Mon, 05 Aug 2019 21:09:00 -0000 Message-ID: x-microsoft-original-message-id: <590f0ba7-8a14-233c-792a-c982937ebc79@hotmail.de> Content-Type: multipart/mixed; boundary="_002_VI1PR10MB257324749689D46FB73B5400E4DA0VI1PR10MB2573EURP_" MIME-Version: 1.0 X-SW-Source: 2019-08/txt/msg00307.txt.bz2 --_002_VI1PR10MB257324749689D46FB73B5400E4DA0VI1PR10MB2573EURP_ Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable Content-length: 810 Hi! PR 91109 is a wrong-code bug, where LRA is using a scratch register which is actually not available for use, and thus gets clobbered when it should not. That seems to be mostly because the live range info of the cloned schatch register is not working the way how update_scrac= h_ops sets up the new register. Moreover for the new register there is a much better alternative free register available, so that just not trying the re-use the previous hard register assignment solves the problem. For more background please see the bugzilla PR 91109. Since I am able to reproduce this bug with latest gcc-9 branch, I want to ask right away, if it is okay to back-port after a while. Boot-strapped and reg-tested on x86_64-pc-linux-gnu and armv7-linux-gnueabi= hf. Is it OK for trunk? Thanks, Bernd. --_002_VI1PR10MB257324749689D46FB73B5400E4DA0VI1PR10MB2573EURP_ Content-Type: text/x-patch; name="patch-pr91109.diff" Content-Description: patch-pr91109.diff Content-Disposition: attachment; filename="patch-pr91109.diff"; size=1261; creation-date="Mon, 05 Aug 2019 20:37:26 GMT"; modification-date="Mon, 05 Aug 2019 20:37:26 GMT" Content-ID: Content-Transfer-Encoding: base64 Content-length: 1713 MjAxOS0wNy0zMCAgQmVybmQgRWRsaW5nZXIgIDxiZXJuZC5lZGxpbmdlckBo b3RtYWlsLmRlPgoKCVBSIHRyZWUtb3B0aW1pemF0aW9uLzkxMTA5CgkqIGxy YS1yZW1hdC5jICh1cGRhdGVfc2NyYXRjaF9vcHMpOiBSZW1vdmUgYXNzaWdu bWVudCBvZiB0aGUKCWhhcmQgcmVnaXN0ZXIuCgpJbmRleDogZ2NjL2xyYS1y ZW1hdC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGdjYy9scmEtcmVt YXQuYwkocmV2aXNpb24gMjczNzY3KQorKysgZ2NjL2xyYS1yZW1hdC5jCSh3 b3JraW5nIGNvcHkpCkBAIC0xMDIxLDcgKzEwMjEsNiBAQCBnZXRfaGFyZF9y ZWdzIChzdHJ1Y3QgbHJhX2luc25fcmVnICpyZWcsIGludCAmbnJlZwogc3Rh dGljIHZvaWQKIHVwZGF0ZV9zY3JhdGNoX29wcyAocnR4X2luc24gKnJlbWF0 X2luc24pCiB7Ci0gIGludCBoYXJkX3JlZ25vOwogICBscmFfaW5zbl9yZWNv Z19kYXRhX3QgaWQgPSBscmFfZ2V0X2luc25fcmVjb2dfZGF0YSAocmVtYXRf aW5zbik7CiAgIHN0cnVjdCBscmFfc3RhdGljX2luc25fZGF0YSAqc3RhdGlj X2lkID0gaWQtPmluc25fc3RhdGljX2RhdGE7CiAgIGZvciAoaW50IGkgPSAw OyBpIDwgc3RhdGljX2lkLT5uX29wZXJhbmRzOyBpKyspCkBAIC0xMDMyLDE3 ICsxMDMxLDkgQEAgdXBkYXRlX3NjcmF0Y2hfb3BzIChydHhfaW5zbiAqcmVt YXRfaW5zbikKICAgICAgIGludCByZWdubyA9IFJFR05PICgqbG9jKTsKICAg ICAgIGlmICghIGxyYV9mb3JtZXJfc2NyYXRjaF9wIChyZWdubykpCiAJY29u dGludWU7Ci0gICAgICBoYXJkX3JlZ25vID0gcmVnX3JlbnVtYmVyW3JlZ25v XTsKICAgICAgICpsb2MgPSBscmFfY3JlYXRlX25ld19yZWcgKEdFVF9NT0RF ICgqbG9jKSwgKmxvYywKIAkJCQkgbHJhX2dldF9hbGxvY25vX2NsYXNzIChy ZWdubyksCiAJCQkJICJzY3JhdGNoIHBzZXVkbyBjb3B5Iik7Ci0gICAgICBp ZiAoaGFyZF9yZWdubyA+PSAwKQotCXsKLQkgIHJlZ19yZW51bWJlcltSRUdO TyAoKmxvYyldID0gaGFyZF9yZWdubzsKLQkgIGlmIChscmFfZHVtcF9maWxl KQotCSAgICBmcHJpbnRmIChscmFfZHVtcF9maWxlLCAiCSBBc3NpZ25pbmcg dGhlIHNhbWUgJWQgdG8gciVkXG4iLAotCQkgICAgIFJFR05PICgqbG9jKSwg aGFyZF9yZWdubyk7Ci0JfQogICAgICAgbHJhX3JlZ2lzdGVyX25ld19zY3Jh dGNoX29wIChyZW1hdF9pbnNuLCBpLCBpZC0+aWNvZGUpOwogICAgIH0KICAg Cg== --_002_VI1PR10MB257324749689D46FB73B5400E4DA0VI1PR10MB2573EURP_--