From patchwork Tue Sep 12 07:02:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 137985 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp223046vqx; Tue, 12 Sep 2023 00:03:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHSM+T6NquhCRNAFqp1QYpEieGJgiK+joFABfRQpqvnzmW1v/PkFTXdFsj55PEAv8jRPmG X-Received: by 2002:a17:906:3053:b0:9a6:8219:6e0b with SMTP id d19-20020a170906305300b009a682196e0bmr9614590ejd.35.1694502226370; Tue, 12 Sep 2023 00:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694502226; cv=none; d=google.com; s=arc-20160816; b=od6H/2r1OLcW4I24sMhV3ORWpqoF4zfh7fcOrNneauEBVyV5Aqw0h8mU3hOg7TTlwO U/IOlJVJYGTpnb/vyFQbMfXjshBMOSs7CWymJZ/DGEr1A3jDL/t2LZ10ZpaIX0WetmLA GD7L4EJVADonQTKs4nycuvTwP0cyOioNGR2+MEczeM6PKtpGFWKKy3epAR+9niYt+MYl fgwFVc0MRGVq6M95VfAKyY3Y4g5oIRe3fOEVgP4weeMm1Zf9zoM6IIZ38shAElRzZnQ3 kMHL6YW43QNmWgM6azPVg8vqJKCzuE+Mj6ESp8Y5rTDTt0fDFlkH10VX7lOxM6BNKB62 7tbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:in-reply-to:mime-version:references:message-id :subject:cc:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=8lotJGt/D6O4vFT5+SYgCLHaGKEqHgE5psQbSi92NIY=; fh=qW0ZDVO53fslnEdj+3xjn1giMsSEqZwmWUR7Clazwuw=; b=C4ZV1ND5PRfZOPfKoAeE6Kf67Y412vSo0gqBPV0qB0chaR1x0/zAT8eBie097t/MCd 9n+laFjWAbaiSQxpE1hy1LGO1qmYQw7Ic9+BX3ks3ujxEnDEWgu0btIPw6p/77fjptPI EHP0Z84mMHJjyjrPzyz8xOd06zLXv7DZJ4wuyf3nwRMuGMmkgjM19ybc++Xm+TEJ6wXH 7bfPy2RtJRf29ISLEt2Q3nUpw1XKPmBVHULRBNUkOEgfxHRBbv6ZtNfmcFFfKbwR0jXN BvV1XZoXdC7T6gLP5hG/ut/Neyn8I4uQeDENYcmFY+1KPmET6TbeO89DmYdr4P3VABhz CL6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="qHm/595O"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id e9-20020a1709067e0900b009a9e1e4e464si7953509ejr.186.2023.09.12.00.03.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="qHm/595O"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C7318385841F for ; Tue, 12 Sep 2023 07:03:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7318385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694502224; bh=8lotJGt/D6O4vFT5+SYgCLHaGKEqHgE5psQbSi92NIY=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=qHm/595OStv31Bc2zcZyvI3NaWMiaoE5T+LeeSHjMzY7rqcd+jIYucLhH2hqmhNXY 4WX8OaJ1j/yBKf6pmIVn/yxAW+s/aXiuXuxFnopj+ALmYQgD9mdrdOisI2DkYPtAac KUeFc+rFyIru3sOc5BiboHlcYFjCpNn1f1Zxpmls= 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 ESMTPS id 35C803858C30 for ; Tue, 12 Sep 2023 07:03:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 35C803858C30 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-364-yY5fgeQ5OTKTOiQAqisZSQ-1; Tue, 12 Sep 2023 03:02:58 -0400 X-MC-Unique: yY5fgeQ5OTKTOiQAqisZSQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0B14101FAA1; Tue, 12 Sep 2023 07:02:57 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.225.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 647862026D68; Tue, 12 Sep 2023 07:02:57 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 38C72tZS3696663 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 09:02:55 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 38C72tVr3696662; Tue, 12 Sep 2023 09:02:55 +0200 Date: Tue, 12 Sep 2023 09:02:55 +0200 To: Benjamin Priour , David Malcolm Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite work-around compound-assignment-1.c C++ failures on various targets [PR111377] Message-ID: References: <202309092344.389NiSeQ3407880@shliclel4214.sh.intel.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.4 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_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776814366059002985 X-GMAIL-MSGID: 1776814366059002985 On Mon, Sep 11, 2023 at 11:11:30PM +0200, Jakub Jelinek via Gcc-patches wrote: > On Mon, Sep 11, 2023 at 07:27:57PM +0200, Benjamin Priour via Gcc-patches wrote: > > Thanks for the report, > > > > After investigation it seems the location of the new dejagnu directive for > > C++ differs depending on the configuration. > > The expected warning is still emitted, but its location differ slightly. > > I expect it to be not an issue per se of the analyzer, but a divergence in > > the FE between the two configurations. > > I think the divergence is whether called_by_test_5b returns the struct > in registers or in memory. If in memory (like in the x86_64 -m32 case), we have > [compound-assignment-1.c:71:21] D.3191 = called_by_test_5b (); [return slot optimization] > [compound-assignment-1.c:71:21 discrim 1] D.3191 ={v} {CLOBBER(eol)}; > [compound-assignment-1.c:72:1] return; > in the IL, while if in registers (like x86_64 -m64 case), just > [compound-assignment-1.c:71:21] D.3591 = called_by_test_5b (); > [compound-assignment-1.c:72:1] return; > > If you just want to avoid the differences, putting } on the same line as the > call might be a usable workaround for that. Here is the workaround in patch form. Tested on x86_64-linux -m32/-m64, ok for trunk? 2023-09-12 Jakub Jelinek PR testsuite/111377 * c-c++-common/analyzer/compound-assignment-1.c (test_5b): Move closing } to the same line as the call to work-around differences in diagnostics line. Jakub --- gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c.jj 2023-09-11 11:05:47.523727789 +0200 +++ gcc/testsuite/c-c++-common/analyzer/compound-assignment-1.c 2023-09-12 08:58:52.854231161 +0200 @@ -68,5 +68,8 @@ called_by_test_5b (void) void test_5b (void) { - called_by_test_5b (); -} /* { dg-warning "leak of '.ptr_wrapper::ptr'" "" { target c++ } } */ + called_by_test_5b (); } +/* { dg-warning "leak of '.ptr_wrapper::ptr'" "" { target c++ } .-1 } */ +/* The closing } above is intentionally on the same line as the call, because + otherwise the exact line of the diagnostics depends on whether the + called_by_test_5b () call satisfies aggregate_value_p or not. */