From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7883 invoked by alias); 1 Aug 2007 07:22:42 -0000 Received: (qmail 7872 invoked by uid 22791); 1 Aug 2007 07:22:40 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Aug 2007 07:22:36 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id l717MXN9099908 for ; Wed, 1 Aug 2007 07:22:33 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.4) with ESMTP id l717MPnP897152 for ; Wed, 1 Aug 2007 09:22:33 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l717M95E013903 for ; Wed, 1 Aug 2007 09:22:09 +0200 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l717M8EB013240 for ; Wed, 1 Aug 2007 09:22:08 +0200 Subject: [patch] [autovect] bugfix in outer-loop vectorization To: gcc-patches@gcc.gnu.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Dorit Nuzman Date: Wed, 01 Aug 2007 07:22:00 -0000 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=4DBBF9B9DFB431A88f9e8a93df938690918c4DBBF9B9DFB431A8" Content-Disposition: inline X-IsSubscribed: yes 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 X-SW-Source: 2007-08/txt/msg00013.txt.bz2 --0__=4DBBF9B9DFB431A88f9e8a93df938690918c4DBBF9B9DFB431A8 Content-type: text/plain; charset=US-ASCII Content-length: 1516 We can't allow vectorization of widneing reduction patterns like DOT_PROD and WIDEN_SUM when their results are used in the loop. This is because these idioms compute N widened results and then reduce them into N/2 results by summing-up pairs of results. So if we need to use (say store) the original N results we cannot use this idiom. (In innermost-loop vectorization this cannot happen because a reduction cannot be used in the loop. However, in outer-loop vectorization, a reduction in the inner-loop can be used in the outer-loop). Bootstrapped with vectorization enabled and tested on the vectorizer testcases on powerpc64-linux. Committed to autovect branch. dorit * tree-vect-analyze.c (vect_mark_relevant): Don't mark widening reduction patterns as relevant if they are used in the outer-loop (we want to vectorize the original sequence instead). (vect_mark_stmts_to_be_vectorized): Add an assert. * tree-vect-transform.c (vect_finalize_reduction): Set a stmt_info. * gcc.dg/vect/vect-outer-4e.c: New test. * gcc.dg/vect/vect-outer-4f.c: New test. * gcc.dg/vect/vect-outer-4g.c: New test. * gcc.dg/vect/no-section-anchors-vect-outer-4h.c: New test. * gcc.dg/vect/vect-outer-4i.c: New test. * gcc.dg/vect/vect-outer-4j.c: New test. * gcc.dg/vect/vect-outer-4k.c: New test. * gcc.dg/vect/vect-outer-4l.c: New test. * gcc.dg/vect/vect-outer-4m.c: New test. (See attached file: autovectfix.txt) --0__=4DBBF9B9DFB431A88f9e8a93df938690918c4DBBF9B9DFB431A8 Content-type: text/plain; name="autovectfix.txt" Content-Disposition: attachment; filename="autovectfix.txt" Content-transfer-encoding: base64 Content-length: 19866 SW5kZXg6IHRlc3RzdWl0ZS9nY2MuZGcvdmVjdC92ZWN0LW91dGVyLTRnLmMK PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PQotLS0gdGVzdHN1aXRlL2djYy5kZy92 ZWN0L3ZlY3Qtb3V0ZXItNGcuYwkocmV2aXNpb24gMCkKKysrIHRlc3RzdWl0 ZS9nY2MuZGcvdmVjdC92ZWN0LW91dGVyLTRnLmMJKHJldmlzaW9uIDApCkBA IC0wLDAgKzEsNTQgQEAKKy8qIHsgZGctcmVxdWlyZS1lZmZlY3RpdmUtdGFy Z2V0IHZlY3RfaW50IH0gKi8KKyNpbmNsdWRlIDxzdGRhcmcuaD4KKyNpbmNs dWRlICJ0cmVlLXZlY3QuaCIKKworI2RlZmluZSBOIDQwCisjZGVmaW5lIE0g MTI4Cit1bnNpZ25lZCBzaG9ydCBpbltOK01dOwordW5zaWduZWQgaW50IG91 dFtOXTsKKworLyogT3V0ZXItbG9vcCB2ZWN0b3JpemF0aW9uLiAqLworLyog Tm90IHZlY3Rvcml6ZWQgZHVlIHRvIG11bHRpcGxlLXR5cGVzIGluIHRoZSBp bm5lci1sb29wLiAgKi8KKwordW5zaWduZWQgaW50Citmb28gKCl7CisgIGlu dCBpLGo7CisgIHVuc2lnbmVkIGludCBkaWZmOworICB1bnNpZ25lZCBpbnQg cz0wOworCisgIGZvciAoaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICBkaWZm ID0gMDsKKyAgICBmb3IgKGogPSAwOyBqIDwgTTsgais9OCkgeworICAgICAg ZGlmZiArPSBpbltqK2ldOworICAgIH0KKyAgICBzKz1kaWZmOworICB9Cisg IHJldHVybiBzOworfQorCitpbnQgbWFpbiAodm9pZCkKK3sKKyAgaW50IGks IGo7CisgIHVuc2lnbmVkIGludCBkaWZmOworICB1bnNpZ25lZCBpbnQgcyxz dW09MDsKKworICBjaGVja192ZWN0ICgpOworCisgIHN1bT1mb28gKCk7CisK KyAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgeworICAgIGRpZmYgPSAwOwor ICAgIGZvciAoaiA9IDA7IGogPCBNOyBqKz04KSB7CisgICAgICBkaWZmICs9 IGluW2oraV07CisgICAgfQorICAgIHMgKz0gZGlmZjsKKyAgfQorCisgIGlm IChzICE9IHN1bSkKKyAgICBhYm9ydCAoKTsKKworICByZXR1cm4gMDsKK30K KworLyogeyBkZy1maW5hbCB7IHNjYW4tdHJlZS1kdW1wLXRpbWVzICJPVVRF UiBMT09QIFZFQ1RPUklaRUQiIDEgInZlY3QiIHsgeGZhaWwgKi0qLSogfSB9 IH0gKi8KKy8qIHsgZGctZmluYWwgeyBjbGVhbnVwLXRyZWUtZHVtcCAidmVj dCIgfSB9ICovCkluZGV4OiB0ZXN0c3VpdGUvZ2NjLmRnL3ZlY3QvdmVjdC1v dXRlci00aS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHRlc3RzdWl0 ZS9nY2MuZGcvdmVjdC92ZWN0LW91dGVyLTRpLmMJKHJldmlzaW9uIDApCisr KyB0ZXN0c3VpdGUvZ2NjLmRnL3ZlY3QvdmVjdC1vdXRlci00aS5jCShyZXZp c2lvbiAwKQpAQCAtMCwwICsxLDI4IEBACisvKiB7IGRnLWRvIGNvbXBpbGUg fSAqLworCisjZGVmaW5lIE4gNDAKKyNkZWZpbmUgTSAxMjgKK3Vuc2lnbmVk IGNoYXIgaW5bTitNXTsKK3Vuc2lnbmVkIHNob3J0IG91dFtOXTsKKworLyog T3V0ZXItbG9vcCB2ZWN0b3JpemF0aW9uLiAqLworLyogTm90IHZlY3Rvcml6 ZWQgZHVlIHRvIG11bHRpcGxlLXR5cGVzIGluIHRoZSBpbm5lci1sb29wLiAg Ki8KKwordW5zaWduZWQgc2hvcnQKK2ZvbyAoKXsKKyAgaW50IGksajsKKyAg dW5zaWduZWQgc2hvcnQgZGlmZjsKKyAgdW5zaWduZWQgc2hvcnQgcz0wOwor CisgIGZvciAoaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICBkaWZmID0gMDsK KyAgICBmb3IgKGogPSAwOyBqIDwgTTsgais9OCkgeworICAgICAgZGlmZiAr PSBpbltqK2ldOworICAgIH0KKyAgICBzKz1kaWZmOworICB9CisgIHJldHVy biBzOworfQorCisvKiB7IGRnLWZpbmFsIHsgc2Nhbi10cmVlLWR1bXAtdGlt ZXMgIk9VVEVSIExPT1AgVkVDVE9SSVpFRCIgMSAidmVjdCIgeyB4ZmFpbCAq LSotKiB9IH0gfSAqLworLyogeyBkZy1maW5hbCB7IGNsZWFudXAtdHJlZS1k dW1wICJ2ZWN0IiB9IH0gKi8KSW5kZXg6IHRlc3RzdWl0ZS9nY2MuZGcvdmVj dC92ZWN0LW91dGVyLTRqLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g dGVzdHN1aXRlL2djYy5kZy92ZWN0L3ZlY3Qtb3V0ZXItNGouYwkocmV2aXNp b24gMCkKKysrIHRlc3RzdWl0ZS9nY2MuZGcvdmVjdC92ZWN0LW91dGVyLTRq LmMJKHJldmlzaW9uIDApCkBAIC0wLDAgKzEsMjYgQEAKKy8qIHsgZGctZG8g Y29tcGlsZSB9ICovCisKKyNkZWZpbmUgTiA0MAorI2RlZmluZSBNIDEyOAor dW5zaWduZWQgY2hhciBpbltOK01dOwordW5zaWduZWQgc2hvcnQgb3V0W05d OworCisvKiBPdXRlci1sb29wIHZlY3Rvcml6YXRpb24uICovCisvKiBOb3Qg dmVjdG9yaXplZCBkdWUgdG8gbXVsdGlwbGUtdHlwZXMgaW4gdGhlIGlubmVy LWxvb3AuICAqLworCit2b2lkCitmb28gKCl7CisgIGludCBpLGo7CisgIHVu c2lnbmVkIHNob3J0IGRpZmY7CisKKyAgZm9yIChpID0gMDsgaSA8IE47IGkr KykgeworICAgIGRpZmYgPSAwOworICAgIGZvciAoaiA9IDA7IGogPCBNOyBq Kz04KSB7CisgICAgICBkaWZmICs9IGluW2oraV07CisgICAgfQorICAgIG91 dFtpXT1kaWZmOworICB9Cit9CisKKy8qIHsgZGctZmluYWwgeyBzY2FuLXRy ZWUtZHVtcC10aW1lcyAiT1VURVIgTE9PUCBWRUNUT1JJWkVEIiAxICJ2ZWN0 IiB7IHhmYWlsICotKi0qIH0gfSB9ICovCisvKiB7IGRnLWZpbmFsIHsgY2xl YW51cC10cmVlLWR1bXAgInZlY3QiIH0gfSAqLwpJbmRleDogdGVzdHN1aXRl L2djYy5kZy92ZWN0L25vLXNlY3Rpb24tYW5jaG9ycy12ZWN0LW91dGVyLTRo LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdGVzdHN1aXRlL2djYy5k Zy92ZWN0L25vLXNlY3Rpb24tYW5jaG9ycy12ZWN0LW91dGVyLTRoLmMJKHJl dmlzaW9uIDApCisrKyB0ZXN0c3VpdGUvZ2NjLmRnL3ZlY3Qvbm8tc2VjdGlv bi1hbmNob3JzLXZlY3Qtb3V0ZXItNGguYwkocmV2aXNpb24gMCkKQEAgLTAs MCArMSw0NyBAQAorLyogeyBkZy1yZXF1aXJlLWVmZmVjdGl2ZS10YXJnZXQg dmVjdF9pbnQgfSAqLworI2luY2x1ZGUgPHN0ZGFyZy5oPgorI2luY2x1ZGUg InRyZWUtdmVjdC5oIgorCisKKyNkZWZpbmUgTiA0MAorI2RlZmluZSBNIDEy OAordW5zaWduZWQgc2hvcnQgYVtNXVtOXTsKK3Vuc2lnbmVkIGludCBvdXRb Tl07CisKKy8qIE91dGVyLWxvb3AgdmVjdG9yaXphdGlvbi4gKi8KKwordm9p ZAorZm9vICgpeworICBpbnQgaSxqOworICB1bnNpZ25lZCBpbnQgZGlmZjsK KworICBmb3IgKGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgZm9yIChqID0g MDsgaiA8IE07IGorKykgeworICAgICAgYVtqXVtpXSA9IDQ7CisgICAgfQor ICAgIG91dFtpXT01OworICB9Cit9CisKK2ludCBtYWluICh2b2lkKQorewor ICBpbnQgaSwgajsKKyAgY2hlY2tfdmVjdCAoKTsKKworICBmb28gKCk7CisK KyAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgeworICAg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25lZCBpbnQgZGlmZjsKKyAgdW5zaWduZWQgaW50IHM9MDsKKworICBm b3IgKGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgZGlmZiA9IDA7CisgICAg Zm9yIChqID0gMDsgaiA8IE07IGorPTgpIHsKKyAgICAgIGRpZmYgKz0gaW5b aitpXTsKKyAgICB9CisgICAgcys9KGRpZmY+PjMpOworICB9CisgIHJldHVy biBzOworfQorCitpbnQgbWFpbiAodm9pZCkKK3sKKyAgaW50IGksIGo7Cisg IHVuc2lnbmVkIGludCBkaWZmOworICB1bnNpZ25lZCBpbnQgcyxzdW09MDsK KworICBjaGVja192ZWN0ICgpOworCisgIHN1bT1mb28gKCk7CisKKyAgZm9y IChpID0gMDsgaSA8IE47IGkrKykgeworICAgIGRpZmYgPSAwOworICAgIGZv ciAoaiA9IDA7IGogPCBNOyBqKz04KSB7CisgICAgICBkaWZmICs9IGluW2or aV07CisgICAgfQorICAgIHMgKz0gKGRpZmY+PjMpOworICB9CisKKyAgaWYg KHMgIT0gc3VtKQorICAgIGFib3J0ICgpOworCisgIHJldHVybiAwOworfQor CisvKiB7IGRnLWZpbmFsIHsgc2Nhbi10cmVlLWR1bXAtdGltZXMgIk9VVEVS IExPT1AgVkVDVE9SSVpFRCIgMSAidmVjdCIgeyB4ZmFpbCAqLSotKiB9ICB9 IH0gKi8KKy8qIHsgZGctZmluYWwgeyBjbGVhbnVwLXRyZWUtZHVtcCAidmVj dCIgfSB9ICovCkluZGV4OiB0ZXN0c3VpdGUvZ2NjLmRnL3ZlY3QvdmVjdC1v dXRlci00bC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHRlc3RzdWl0 ZS9nY2MuZGcvdmVjdC92ZWN0LW91dGVyLTRsLmMJKHJldmlzaW9uIDApCisr KyB0ZXN0c3VpdGUvZ2NjLmRnL3ZlY3QvdmVjdC1vdXRlci00bC5jCShyZXZp c2lvbiAwKQpAQCAtMCwwICsxLDU2IEBACisvKiB7IGRnLXJlcXVpcmUtZWZm ZWN0aXZlLXRhcmdldCB2ZWN0X2ludCB9ICovCisjaW5jbHVkZSA8c3RkYXJn Lmg+CisjaW5jbHVkZSAidHJlZS12ZWN0LmgiCisKKyNkZWZpbmUgTiA0MAor I2RlZmluZSBNIDEyOAordW5zaWduZWQgc2hvcnQgaW5bTitNXTsKK3Vuc2ln bmVkIGludCBvdXRbTl07Cit1bnNpZ25lZCBjaGFyIGFycltOXTsKKworLyog T3V0ZXItbG9vcCB2ZWN0b3JpemF0aW9uLiAqLworLyogTm90IHZlY3Rvcml6 ZWQgZHVlIHRvIG11bHRpcGxlLXR5cGVzIGluIHRoZSBpbm5lci1sb29wLiAg Ki8KKwordW5zaWduZWQgaW50Citmb28gKCl7CisgIGludCBpLGo7CisgIHVu c2lnbmVkIGludCBkaWZmOworICB1bnNpZ25lZCBpbnQgcz0wOworCisgIGZv ciAoaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICBhcnJbaV0gPSAzOworICAg IGRpZmYgPSAwOworICAgIGZvciAoaiA9IDA7IGogPCBNOyBqKz04KSB7Cisg ICAgICBkaWZmICs9IGluW2oraV07CisgICAgfQorICAgIHMrPWRpZmY7Cisg IH0KKyAgcmV0dXJuIHM7Cit9CisKK2ludCBtYWluICh2b2lkKQoreworICBp bnQgaSwgajsKKyAgdW5zaWduZWQgaW50IGRpZmY7CisgIHVuc2lnbmVkIGlu dCBzLHN1bT0wOworCisgIGNoZWNrX3ZlY3QgKCk7CisKKyAgc3VtPWZvbyAo KTsKKworICBmb3IgKGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgZGlmZiA9 IDA7CisgICAgZm9yIChqID0gMDsgaiA8IE07IGorPTgpIHsKKyAgICAgIGRp ZmYgKz0gaW5baitpXTsKKyAgICB9CisgICAgcyArPSBkaWZmOworICB9CisK KyAgaWYgKHMgIT0gc3VtKQorICAgIGFib3J0ICgpOworCisgIHJldHVybiAw OworfQorCisvKiB7IGRnLWZpbmFsIHsgc2Nhbi10cmVlLWR1bXAtdGltZXMg Ik9VVEVSIExPT1AgVkVDVE9SSVpFRCIgMSAidmVjdCIgeyB4ZmFpbCAqLSot KiB9IH0gfSAqLworLyogeyBkZy1maW5hbCB7IGNsZWFudXAtdHJlZS1kdW1w ICJ2ZWN0IiB9IH0gKi8KSW5kZXg6IHRlc3RzdWl0ZS9nY2MuZGcvdmVjdC92 ZWN0LW91dGVyLTRlLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdGVz dHN1aXRlL2djYy5kZy92ZWN0L3ZlY3Qtb3V0ZXItNGUuYwkocmV2aXNpb24g MCkKKysrIHRlc3RzdWl0ZS9nY2MuZGcvdmVjdC92ZWN0LW91dGVyLTRlLmMJ KHJldmlzaW9uIDApCkBAIC0wLDAgKzEsMjUgQEAKKy8qIHsgZGctZG8gY29t cGlsZSB9ICovCisKKyNkZWZpbmUgTiA0MAorI2RlZmluZSBNIDEyOAordW5z aWduZWQgaW50IGluW04rTV07Cit1bnNpZ25lZCBzaG9ydCBvdXRbTl07CisK Ky8qIE91dGVyLWxvb3AgdmVjdG9yaXphdGlvbi4gKi8KKwordm9pZAorZm9v ICgpeworICBpbnQgaSxqOworICB1bnNpZ25lZCBpbnQgZGlmZjsKKworICBm b3IgKGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgZGlmZiA9IDA7CisgICAg Zm9yIChqID0gMDsgaiA8IE07IGorPTgpIHsKKyAgICAgIGRpZmYgKz0gaW5b aitpXTsKKyAgICB9CisgICAgb3V0W2ldPSh1bnNpZ25lZCBzaG9ydClkaWZm OworICB9Cit9CisKKy8qIHsgZGctZmluYWwgeyBzY2FuLXRyZWUtZHVtcC10 aW1lcyAiT1VURVIgTE9PUCBWRUNUT1JJWkVEIiAxICJ2ZWN0IiB7IHhmYWls ICotKi0qIH0gfSB9ICovCisvKiB7IGRnLWZpbmFsIHsgY2xlYW51cC10cmVl LWR1bXAgInZlY3QiIH0gfSAqLwpJbmRleDogdGVzdHN1aXRlL2djYy5kZy92 ZWN0L3ZlY3Qtb3V0ZXItNG0uYwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t LSB0ZXN0c3VpdGUvZ2NjLmRnL3ZlY3QvdmVjdC1vdXRlci00bS5jCShyZXZp c2lvbiAwKQorKysgdGVzdHN1aXRlL2djYy5kZy92ZWN0L3ZlY3Qtb3V0ZXIt NG0uYwkocmV2aXNpb24gMCkKQEAgLTAsMCArMSw1NCBAQAorLyogeyBkZy1y ZXF1aXJlLWVmZmVjdGl2ZS10YXJnZXQgdmVjdF9pbnQgfSAqLworI2luY2x1 ZGUgPHN0ZGFyZy5oPgorI2luY2x1ZGUgInRyZWUtdmVjdC5oIgorCisjZGVm aW5lIE4gNDAKKyNkZWZpbmUgTSAxMjgKK3Vuc2lnbmVkIHNob3J0IGluW04r TV07Cit1bnNpZ25lZCBpbnQgb3V0W05dOworCisvKiBPdXRlci1sb29wIHZl Y3Rvcml6YXRpb24uICovCisvKiBOb3QgdmVjdG9yaXplZCBkdWUgdG8gbXVs dGlwbGUtdHlwZXMgaW4gdGhlIGlubmVyLWxvb3AuICAqLworCit1bnNpZ25l ZCBpbnQKK2ZvbyAoKXsKKyAgaW50IGksajsKKyAgdW5zaWduZWQgaW50IGRp ZmY7CisgIHVuc2lnbmVkIGludCBzPTA7CisKKyAgZm9yIChpID0gMDsgaSA8 IE47IGkrKykgeworICAgIGRpZmYgPSAwOworICAgIGZvciAoaiA9IDA7IGog PCBNOyBqKz04KSB7CisgICAgICBkaWZmICs9IGluW2oraV07CisgICAgfQor ICAgIHMrPSgodW5zaWduZWQgc2hvcnQpZGlmZj4+Myk7CisgIH0KKyAgcmV0 dXJuIHM7Cit9CisKK2ludCBtYWluICh2b2lkKQoreworICBpbnQga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WQgaW50IG91dFtOXTsKKworLyogT3V0ZXItbG9vcCB2ZWN0b3JpemF0 aW9uLiAqLworLyogTm90IHZlY3Rvcml6ZWQgZHVlIHRvIG11bHRpcGxlLXR5 cGVzIGluIHRoZSBpbm5lci1sb29wLiAgKi8KKwordm9pZAorZm9vICgpewor ICBpbnQgaSxqOworICB1bnNpZ25lZCBpbnQgZGlmZjsKKworICBmb3IgKGkg PSAwOyBpIDwgTjsgaSsrKSB7CisgICAgZGlmZiA9IDA7CisgICAgZm9yIChq ID0gMDsgaiA8IE07IGorPTgpIHsKKyAgICAgIGRpZmYgKz0gaW5baitpXTsK KyAgICB9CisgICAgb3V0W2ldPWRpZmY7CisgIH0KK30KKworaW50IG1haW4g KHZvaWQpCit7CisgIGludCBpLCBqOworICB1bnNpZ25lZCBpbnQgZGlmZjsK KworICBjaGVja192ZWN0ICgpOworCisgIGZvbyAoKTsKKworICBmb3IgKGkg PSAwOyBpIDwgTjsgaSsrKSB7CisgICAgZGlmZiA9IDA7CisgICAgZm9yIChq ID0gMDsgaiA8IE07IGorPTgpIHsKKyAgICAgIGRpZmYgKz0gaW5baitpXTsK KyAgICB9CisgICAgaWYgKG91dFtpXSAhPSBkaWZmKQorICAgICAgYWJvcnQg KCk7CisgIH0KKworICByZXR1cm4gMDsKK30KKworLyogeyBkZy1maW5hbCB7 IHNjYW4tdHJlZS1kdW1wLXRpbWVzICJPVVRFUiBMT09QIFZFQ1RPUklaRUQi IDEgInZlY3QiIHsgeGZhaWwgKi0qLSogfSB9IH0gKi8KKy8qIHsgZGctZmlu YWwgeyBjbGVhbnVwLXRyZWUtZHVtcCAidmVjdCIgfSB9ICovCkluZGV4OiB0 cmVlLXZlY3QtYW5hbHl6ZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t IHRyZWUtdmVjdC1hbmFseXplLmMJKHJldmlzaW9uIDEyNzA4NikKKysrIHRy ZWUtdmVjdC1hbmFseXplLmMJKHdvcmtpbmcgY29weSkKQEAgLTU4OCwxNCAr NTg4LDE0IEBACiAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9 CiAgICAgICBpZiAoIUxPT1BfVklORk9fTklURVJTX0tOT1dOX1AgKGxvb3Bf dmluZm8pCi0gICAgICAgICAgJiYgTE9PUF9WSU5GT19OSVRFUlMgKGxvb3Bf dmluZm8pCi0gICAgICAgICAgJiYgVFJFRV9DT0RFIChMT09QX1ZJTkZPX05J VEVSUyAobG9vcF92aW5mbykpID09IENPTkRfRVhQUikKLSAgICAgICAgewot ICAgICAgICAgIGlmICh2ZWN0X3ByaW50X2R1bXBfaW5mbyAoUkVQT1JUX1VO VkVDVE9SSVpFRF9MT09QUykpCi0gICAgICAgICAgICBmcHJpbnRmICh2ZWN0 X2R1bXAsCi0gICAgICAgICAgICAgICAgICAgICJub3QgdmVjdG9yaXplZDog Y2FuJ3QgY3JlYXRlIGVwaWxvZyBsb29wIDIuIik7Ci0gICAgICAgICAgcmV0 dXJuIGZhbHNlOwotICAgICAgICB9CisJICAmJiBMT09QX1ZJTkZPX05JVEVS UyAobG9vcF92aW5mbykKKwkgICYmIFRSRUVfQ09ERSAoTE9PUF9WSU5GT19O SVRFUlMgKGxvb3BfdmluZm8pKSA9PSBDT05EX0VYUFIpCisJeworCSAgaWYg KHZlY3RfcHJpbnRfZHVtcF9pbmZvIChSRVBPUlRfVU5WRUNUT1JJWkVEX0xP T1BTKSkKKwkgICAgZnByaW50ZiAodmVjdF9kdW1wLAorCQkgICAgICJub3Qg dmVjdG9yaXplZDogY2FuJ3QgY3JlYXRlIGVwaWxvZyBsb29wIDIuIik7CisJ ICAgIHJldHVybiBmYWxzZTsKKwl9CiAgICAgICBpZiAoIXNscGVlbF9jYW5f ZHVwbGljYXRlX2xvb3BfcCAobG9vcCwgc2luZ2xlX2V4aXQgKGxvb3ApKSkK ICAgICAgICAgewogICAgICAgICAgIGlmICh2ZWN0X3Bya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