[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 Richard Biener changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread andysem at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #9 from andysem at mail dot ru --- Ok, so it seems then that what I need cannot be implemented portably. In that case, this bug can be closed. Thanks to everyone. But we do need a solution for bug #88101 (and Boost.Atomic) eventually.

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread andysem at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #8 from andysem at mail dot ru --- (In reply to rguent...@suse.de from comment #5) > > Is there any other way to achieve the effect of initializing padding in a > > struct? > > The only way I see would be to do that inside the constru

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #7 from Jonathan Wakely --- (In reply to andysem from comment #4) > Are you saying that implementation is allowed to not preserve unused storage > state upon construction and assignment? Because I don't think this is what > the standa

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #6 from Jonathan Wakely --- (In reply to andysem from comment #0) > It doesn't say anything about modifying padding bits, It also doesn't say anything about leaving them with their previous values. I think your expectation is wrong.

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #5 from rguenther at suse dot de --- On Tue, 25 Feb 2020, andysem at mail dot ru wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 > > --- Comment #4 from andysem at mail dot ru --- > Are you saying that implementation is

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread andysem at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #4 from andysem at mail dot ru --- Are you saying that implementation is allowed to not preserve unused storage state upon construction and assignment? Because I don't think this is what the standard says. Is there any other way to ac

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed|

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-24 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #2 from Andrew Pinski --- std::memset(storage.bytes, 0, sizeof(storage.bytes)); From* p = new (storage.bytes) From(from); The memset here is considered as Dead code.

[Bug c++/93916] Implicit copy/assignment alters padding bits of storage

2020-02-24 Thread andysem at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916 --- Comment #1 from andysem at mail dot ru --- Created attachment 47902 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47902&action=edit A test case that demonstrates the problem