From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40599 invoked by alias); 26 Oct 2015 12:32:53 -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 40543 invoked by uid 89); 26 Oct 2015 12:32:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Oct 2015 12:32:49 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-24-x2351ixEQtaBiIBv73jZNw-1; Mon, 26 Oct 2015 12:32:44 +0000 Received: from [10.45.32.46] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 26 Oct 2015 12:32:43 +0000 User-Agent: Microsoft-MacOutlook/14.5.7.151005 Date: Mon, 26 Oct 2015 12:54:00 -0000 Subject: [Patch] Avoid is_simple_use bug in vectorizable_live_operation From: Alan Hayward To: "gcc-patches@gcc.gnu.org" Message-ID: Mime-version: 1.0 X-MC-Unique: x2351ixEQtaBiIBv73jZNw-1 Content-Type: multipart/mixed; boundary="B_3528707585_5525470" X-SW-Source: 2015-10/txt/msg02733.txt.bz2 > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3528707585_5525470 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 846 There is a potential bug in vectorizable_live_operation. Consider the case where the first op for stmt is valid, but the second is null. The first time through the for () loop, it will call out to vect_is_simple_use () which will set dt. The second time, because op is null, vect_is_simple_use () will not be called. However, dt is still set to a valid value, therefore the loop will continue. Note this is different from the case where the first op is null, which will cause the loop not call vect_is_simple_use () and then return false. It is possible that this was intentional, however that is not clear from the code. The fix is to simply ensure dt is initialized to a default value on each iteration. 2015-09-07 Alan Hayward alan.hayward@arm.com * tree-vect-looop.c (vectorizable_live_operation): localize variable. Cheers, Alan --B_3528707585_5525470 Content-type: application/octet-stream; name="avoid_issimple.patch" Content-disposition: attachment; filename="avoid_issimple.patch" Content-transfer-encoding: base64 Content-length: 907 ZGlmZiAtLWdpdCBhL2djYy90cmVlLXZlY3QtbG9vcC5jIGIvZ2NjL3RyZWUt dmVjdC1sb29wLmMKaW5kZXggOGMyMzk3MjAyMmQ5MmRiZmRiNTc0MmMzMjc0 MDIzM2ZjMjQ2ODRhYS4uNmMwYTkxOWM2YjA1NmJjMjU4ODkwNGE3NDhmY2Qz ZWU4NDQxY2Q1ZCAxMDA2NDQKLS0tIGEvZ2NjL3RyZWUtdmVjdC1sb29wLmMK KysrIGIvZ2NjL3RyZWUtdmVjdC1sb29wLmMKQEAgLTU5OTQsNyArNTk5NCw2 IEBAIHZlY3Rvcml6YWJsZV9saXZlX29wZXJhdGlvbiAoZ2ltcGxlIHN0bXQs CiAgIHRyZWUgb3A7CiAgIHRyZWUgZGVmOwogICBnaW1wbGUgZGVmX3N0bXQ7 Ci0gIGVudW0gdmVjdF9kZWZfdHlwZSBkdDsKICAgZW51bSB0cmVlX2NvZGUg Y29kZTsKICAgZW51bSBnaW1wbGVfcmhzX2NsYXNzIHJoc19jbGFzczsKIApA QCAtNjA1OSw2ICs2MDU4LDggQEAgdmVjdG9yaXphYmxlX2xpdmVfb3BlcmF0 aW9uIChnaW1wbGUgc3RtdCwKIAogICBmb3IgKGkgPSAwOyBpIDwgb3BfdHlw ZTsgaSsrKQogICAgIHsKKyAgICAgIGVudW0gdmVjdF9kZWZfdHlwZSBkdCA9 IHZlY3RfdW5pbml0aWFsaXplZF9kZWY7CisKICAgICAgIGlmIChyaHNfY2xh c3MgPT0gR0lNUExFX1NJTkdMRV9SSFMpCiAJb3AgPSBUUkVFX09QRVJBTkQg KGdpbXBsZV9vcCAoc3RtdCwgMSksIGkpOwogICAgICAgZWxzZQo= --B_3528707585_5525470--