[Bug c++/95349] Using std::launder(p) produces unexpected behavior where (p) produces expected behavior

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Thu Jun 4 06:14:26 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349

--- Comment #32 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 4 Jun 2020, andrew2085 at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349
> 
> --- Comment #31 from Andrew Downing <andrew2085 at gmail dot com> ---
> What would you say is the solution here? There's a disconnect between what the
> c++ standard says should work, and what actually works.

I think C++ standards people must come to realize that designing how
TBAA works in a compiler isn't something that can be turned around
every now and then so changing requirements in the standard every
now and then does not work.

I think people will have to live with the reality of existing 
implementations.  Because massive changes like this cannot be
brought to older releases nor can I give any estimate on what
future release of GCC might "support" this "feature" of the
standard.  There's the workaround of disabling type-based
alias anaysis via -fno-strict-aliasing of course.  Mind it took
GCC about 4 to 5 major releases to get placement new work
correctly.  Well, to the reading of the C++11 standard.  So
expect us to be ready with C++20 in about 5 years.

The message to the standards people should also be that C++ does
not live in isolation and modern technology like link-time
optimization has to cope with input from multiple source languages
which means that compilers intermediate language has to cope
with all of them and do optimizations expected by people using
different languages.


More information about the Gcc-bugs mailing list