From patchwork Wed Jun 16 11:22:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1492898 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=CRWpGyar; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G4jV534Rvz9sW8 for ; Wed, 16 Jun 2021 21:23:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E380393BC31 for ; Wed, 16 Jun 2021 11:23:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E380393BC31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623842584; bh=+vqeLA2m9NNJQBLO2JDVXduE0r/J7Dr6Otcbrh/rLzk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CRWpGyar1xDsA8cMpoAouPteggyv/1D0vonGLst7/OAETjPdjcD0IFlnde6yo7dHD REYTxTwIMDcsiLJZUu007i0q6AFXt9eciS/67890kyzX7enU1P4W1R6wB5HEMds81i J2tjtmZI7scS8olHCfRSk7ICbxHFpZqCpdUXFShY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 3746A383F432 for ; Wed, 16 Jun 2021 11:22:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3746A383F432 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-94--CvyBwnjO2yJdieAS3yZkg-1; Wed, 16 Jun 2021 07:22:41 -0400 X-MC-Unique: -CvyBwnjO2yJdieAS3yZkg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA47CCC621 for ; Wed, 16 Jun 2021 11:22:40 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-7.ams2.redhat.com [10.36.112.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A5F55D9E2 for ; Wed, 16 Jun 2021 11:22:40 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 15GBMbrx311037 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 16 Jun 2021 13:22:38 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 15GBMbl5311036 for gcc-patches@gcc.gnu.org; Wed, 16 Jun 2021 13:22:37 +0200 Date: Wed, 16 Jun 2021 13:22:37 +0200 To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Use noipa attribute instead of noinline, noclone Message-ID: <20210616112237.GY7746@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, 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-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! I've noticed this test now on various arches sometimes FAILs, sometimes PASSes (the line 12 test in particular). The problem is that a = 0; initialization in the caller no longer happens before the f(&a) call as what the argument points to is only used in debug info. Making the function noipa forces the caller to initialize it and still tests what the test wants to test, namely that we don't consider *p as valid location for the c variable at line 18 (after it has been overwritten with *p = 1;). Tested on x86_64-linux, committed to trunk as obvious. Wonder if we shouldn't somehow mark PARM_DECLs that point to (directly or indirectly) into memory that IPA optimizations (modref?) chose it is unnecessary to initialize to tell var-tracking that it is unsafe to use MEMs based on those parameters in debug insns... 2021-06-16 Jakub Jelinek * gcc.dg/guality/pr49888.c (f): Use noipa attribute instead of noinline, noclone. Jakub --- gcc/testsuite/gcc.dg/guality/pr49888.c.jj 2020-01-14 20:02:47.308601970 +0100 +++ gcc/testsuite/gcc.dg/guality/pr49888.c 2021-06-16 12:58:54.636184065 +0200 @@ -4,7 +4,7 @@ static int v __attribute__((used)); -static void __attribute__((noinline, noclone)) +static void __attribute__((noipa)) f (int *p) { int c = *p;