This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/71660] [5/6/7/8 regression] alignment of std::atomic<8 byte primitive type> (long long, double) is wrong on x86


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

--- Comment #10 from Thiago Macieira <thiago at kde dot org> ---
Actually, PR 65146 points out that the problem is not efficiency but
correctness. An under-aligned type could cross a cacheline boundary and thus
fail to be atomic in the first place.

Therefore, it is correct to increase the alignment, even if that causes an ABI
change for existing structures. Those structures were disasters waiting to
happen.

I withdraw my bug report. Close it as INVALID or NOTABUG or whatever is
appropriate.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]