From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id B84573858D3C for ; Mon, 17 Jan 2022 19:14:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B84573858D3C Received: by mail-il1-x130.google.com with SMTP id e8so15580392ilm.13 for ; Mon, 17 Jan 2022 11:14:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=7SFfAJgsWBBWVfVTlc00NzeBaiaJ03LFtzVIZMlvLeo=; b=iKO2sRtoR7sTA8dFrbmawhmqijatIZfzI0gjfcTIa992bgunslzktQAfdDMCnbmXKU b9WXMya2uDnvzfrwOdQy1UY++lmJNvd+evI/szTHmiihAXnqpwC8mIyQku4RGoiKtBeB LvWASU0II5dOfvbkSITZCazKCjVKju22rsFf1beSIYupSA4NSaOYOIrby+j3lhJ/9AK1 v4k00dpABLeIgPPkiL5BZtTb2RK/1hAhouDeKKef4+IIQO66MC28g++XmIPA5OwlcJMh VnLCS2KvhMi3fPp9oeUsAlNpM0eG2EtcN+Z829OTjoC20J6hntT8WBm7FdIGryij1/HF /ZHw== X-Gm-Message-State: AOAM530qaAZzoiRwSMNPX/V0M9BRCtIgveUxtHvK3qUbTFCZK8t713Pc WfUsZMs1Dg9qa/KWeEFjvq4= X-Google-Smtp-Source: ABdhPJyhtqFe9I4E5s886lPsaMWxy2ZGzhOk3ADvgTqDGMSu4pK5CoalnR36GuZcK0F/FbKr0T6vfw== X-Received: by 2002:a05:6e02:1908:: with SMTP id w8mr5232777ilu.50.1642446858069; Mon, 17 Jan 2022 11:14:18 -0800 (PST) Received: from [192.168.0.41] (97-118-100-142.hlrn.qwest.net. [97.118.100.142]) by smtp.gmail.com with ESMTPSA id h10sm9586913ilc.73.2022.01.17.11.14.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jan 2022 11:14:17 -0800 (PST) Message-ID: Date: Mon, 17 Jan 2022 12:14:17 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: PING 4 [PATCH v2 2/2] add -Wdangling-pointer [PR #63272] Content-Language: en-US To: Stephan Bergmann , gcc-patches References: <004d5f0a-a92c-31be-c7b5-31f21f853139@redhat.com> <7d5c948e-4a78-54cb-3e35-e3e75c5f8982@gmail.com> <0e7c39fe-e5b1-0df7-3d97-9b1b642488b4@gmail.com> <31748bdb-ec2c-8674-16dc-f28ef5f74c1a@redhat.com> From: Martin Sebor In-Reply-To: <31748bdb-ec2c-8674-16dc-f28ef5f74c1a@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 17 Jan 2022 19:14:20 -0000 On 1/17/22 06:46, Stephan Bergmann wrote: > On 10/01/2022 22:51, Martin Sebor via Gcc-patches wrote: >> Last ping for this stage 1 feature before stage 3 ends: >> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585819.html > > This hits somewhat unexpectedly at (test case reduced from a hit in > LibreOffice) Thanks for the small test case! It seems like the PHI handling (conditionals) might overly simplistic. Let me look into it. I tried to set up OpenOffice for testing with the latest GCC but couldn't get the build to finish (it failed downloading some unavailable prerequisites). I don't remember what problem I ran into with LibreOffice; it was before I upgraded to Fedora 35 just a couple of weeks ago. Let me retry again (the build is still downloading tarballs). In the meantime, do you have any tips or suggestions getting it set up that aren't on the instructions page below? (Especially for using an alternate compiler and non-default options.) https://wiki.documentfoundation.org/Development/BuildingOnLinux#Fedora.2FRedHat Martin > >> $ cat test.cc >> #include >> struct S1 { >>     S1(int); >>     ~S1(); >> }; >> struct S2 { S2(std::initializer_list); }; >> S2 f1(); >> S2 f2(bool b) { return b ? f1() : S2{0}; } > >> $ g++ -Wdangling-pointer -c test.cc >> test.cc: In function ‘S2 f2(bool)’: >> test.cc:8:42: warning: dangling pointer to an unnamed temporary may be >> used [-Wdangling-pointer=] >>     8 | S2 f2(bool b) { return b ? f1() : S2{0}; } >>       |                                          ^ >> test.cc:8:39: note: unnamed temporary defined here >>     8 | S2 f2(bool b) { return b ? f1() : S2{0}; } >>       |                                       ^ >> test.cc:8:42: warning: dangling pointer to an unnamed temporary may be >> used [-Wdangling-pointer=] >>     8 | S2 f2(bool b) { return b ? f1() : S2{0}; } >>       |                                          ^ >> test.cc:8:39: note: unnamed temporary defined here >>     8 | S2 f2(bool b) { return b ? f1() : S2{0}; } >>       |                                       ^ >