From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1EA593858D35 for ; Wed, 26 Jul 2023 16:30:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1EA593858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690389032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mQiv/1qPwmQ1H8HxdkVrY7P9ZVYQKOIYzMVBGFrBhRg=; b=cc8Udb1oPdynBjgR/fdAgIRUwt1+Ruu6qimaDO93MjLL77+ilEFoyMN+ZAiRnpbefwVpCC BCp2lgOleTKsJUjMUv3zKX0IBnSi/4Qe8W80lBRGa46ih2GvwIYrEyRaW3Kmt8FpUUgypY DsVIVymp810UxP2Oao01lLJI5Ru5wrg= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-35-ror4iXK5NrCY7-8WW80-jQ-1; Wed, 26 Jul 2023 12:30:30 -0400 X-MC-Unique: ror4iXK5NrCY7-8WW80-jQ-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-405552f6024so58710171cf.1 for ; Wed, 26 Jul 2023 09:30:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690389030; x=1690993830; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mQiv/1qPwmQ1H8HxdkVrY7P9ZVYQKOIYzMVBGFrBhRg=; b=AUSabwZre/uw/rXTS5uZl81KGFh928UamhUyALjV6qO9SeP3KlZZsAlXXdFpuIxCjt voOWMnBFPwc4UHzue+19Doox4dFprjX+1RKV1keCrTctML2/ozYoEq+3bTcDlAejPVzu /oWeDjXqHf+qEbWRIturco4tdO9Os800nWYI11Nbs7fD9hTTgKzwdKb0FtnTTndkonHz 0PuE3YHD3F53ZwzxN4THWLV2cEq1wAk1y1zFIyVziMBKDTR0WnclXypW2uE/5XJCWUrV Jc3sXBwcPPq6XgF4rsobgz8/213gXi0MPXWR/wJYSxEimtX9h446lFyS+dBlpbrdaDat zk7w== X-Gm-Message-State: ABy/qLZeCeHbQIbmgmJI57KyCf/XBcL/A1yiIDGt3izxawVLdenVqUlu sM9EKa2o7LotlxxdMTZDi97FBS0QUqnRGNV+f2VnhtbmGIALlJhSR/cv8a56S6I8DOzlCE+P7cx SIGqWiqip8A6YjWTQcQ== X-Received: by 2002:ac8:5788:0:b0:403:a261:c021 with SMTP id v8-20020ac85788000000b00403a261c021mr2765795qta.2.1690389030507; Wed, 26 Jul 2023 09:30:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlFQk+LTs98Am/0sE+oNAg9OpL05wg62Ce684Nd1bZ61UJFAripyVUYdRIxXjMQ5529xjcqaPw== X-Received: by 2002:ac8:5788:0:b0:403:a261:c021 with SMTP id v8-20020ac85788000000b00403a261c021mr2765775qta.2.1690389030260; Wed, 26 Jul 2023 09:30:30 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id bb10-20020a05622a1b0a00b0040378535dccsm4877655qtb.43.2023.07.26.09.30.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jul 2023 09:30:29 -0700 (PDT) Message-ID: <722b667b-0da1-7748-23e1-cf09b4ff876d@redhat.com> Date: Wed, 26 Jul 2023 12:30:29 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] c++: devirtualization of array destruction [PR110057] To: Ng YongXiang , gcc-patches@gcc.gnu.org Cc: Xi Ruoyao References: <7523fbf9-30d8-4529-5dd4-0948c9ad3ef9@redhat.com> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 7/26/23 12:00, Ng YongXiang wrote: > Hi Jason, > > Thanks for the reply and review. I've attached an updated patch with the > change log and sign off. > > The change made in gcc/testsuite/g++.dg/warn/pr83054.C is because I > think there is no more warning since we have already devirtualized the > destruction for the array. Makes sense, and it's good to have your adjusted testcase in the testsuite, it should just be a new one (maybe pr83054-2.C). > Apologies for the poor formatting. It is my first time contributing. Do > let me know if there's any stuff I've missed and feel free to modify the > patch where you deem necessary. No worries! The ChangeLog entries still need some adjustment, according to git gcc-verify (from contrib/gcc-git-customization.sh, see https://gcc.gnu.org/gitwrite.html): ERR: line should start with a tab: " * init.c: Call non virtual destructor of objects in array" ERR: line should start with a tab: " * g++.dg/devirt-array-destructor-1.C: New." ERR: line should start with a tab: " * g++.dg/devirt-array-destructor-2.C: New." ERR: line should start with a tab: " * g++.dg/warn/pr83054.C: Remove expected warnings caused by devirtualization" ERR: PR 110057 in subject but not in changelog: "c++: devirtualization of array destruction [PR110057]" git gcc-commit-mklog (also from gcc-git-customization.sh) makes generating ChangeLog entries a lot simpler. > * g++.dg/devirt-array-destructor-1.C: New. Tests that look at tree-optimization dump files should go in the g++.dg/tree-ssa subdirectory. > +/* { dg-do run } */ It seems unnecessary to execute these tests, I'd think the default of { dg-do compile } would be fine. It's also good to have a // PR c++/110057 line at the top of the testcase for future reference. gcc-commit-mklog also uses that to add the PR number to the ChangeLog. Jason