From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id 49DDB385DC00 for ; Tue, 9 Jun 2020 06:37:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 49DDB385DC00 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-an7NCamSPfuVxHzg96vXRQ-1; Tue, 09 Jun 2020 02:37:32 -0400 X-MC-Unique: an7NCamSPfuVxHzg96vXRQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F53C464; Tue, 9 Jun 2020 06:37:31 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B299A60CD0; Tue, 9 Jun 2020 06:37:30 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 0596bREG007613; Tue, 9 Jun 2020 08:37:28 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 0596bQIa007612; Tue, 9 Jun 2020 08:37:26 +0200 Date: Tue, 9 Jun 2020 08:37:26 +0200 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org, ebotcazou@adacore.com Subject: Re: [PATCH] middle-end/95493 - bogus MEM_ATTRS for variable array access Message-ID: <20200609063726.GW8462@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 09 Jun 2020 06:37:40 -0000 On Thu, Jun 04, 2020 at 01:52:53PM +0200, Richard Biener wrote: > * g++.dg/torture/pr95493.C: New testcase. > +using K [[gnu::vector_size(16)]] = int; ... > + int a = [](K y) { > + for (int j = 0; j < 4; ++j) > + if (y[j] != 0) > + return j; > + return -1; > + }(x.d); The lambda has SSE vector argument, so on i686-linux or otherwise with -mno-sse we get a warning at -O0 when the lambda isn't inlined. Fixed thusly, tested on x86_64-linux, committed to trunk as obvious: 2020-06-09 Jakub Jelinek * g++.dg/torture/pr95493.C: Add -Wno-psabi -w to dg-additional-options. --- gcc/testsuite/g++.dg/torture/pr95493.C.jj 2020-06-05 10:42:40.635895301 +0200 +++ gcc/testsuite/g++.dg/torture/pr95493.C 2020-06-09 08:32:47.220113011 +0200 @@ -1,5 +1,5 @@ // { dg-do run } -// { dg-additional-options "-std=c++17" } +// { dg-additional-options "-std=c++17 -Wno-psabi -w" } struct verify { Jakub