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 <initializer_list>
struct S1 {
    S1(int);
    ~S1();
};
struct S2 { S2(std::initializer_list<S1>); };
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}; }
      |                                       ^


Reply via email to