This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/79671] [7 Regression] mapnik miscompilation on armv7hl since r235622
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Mar 2017 09:13:04 +0000
- Subject: [Bug target/79671] [7 Regression] mapnik miscompilation on armv7hl since r235622
- Auto-submitted: auto-generated
- References: <bug-79671-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79671
--- Comment #35 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #34)
> C++14 12.8/16 says
>
> "The implicitly-defined copy/move constructor for a union X copies the
> object representation (3.9) of X."
>
> 3.9/4 says
>
> "The object representation of an object of type T is the sequence of N
> unsigned char objects... For trivially copyable types, the value
> representation is a set of bits in the object representation that determines
> a value,..."
>
> this suggests that the copying should work but the C++ FE may not simply
> elide the copy construction by emitting
>
> c = *p;
>
> because that does _not_ implement memcpy semantics for the union member.
>
> Note the above may not apply at all here if B is POD and thus the assignment
> is an assignment of PODs (I don't know all of the standard).
It would still conflict with the wording of 3.10/10 (that is, if 3.10/10
is fulfilled the middle-end handles the copying above correct).