This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71789] atomic_int incompatibility warning between C and C++ [-Wlto-type-mismatch]
- 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: Thu, 07 Jul 2016 08:36:15 +0000
- Subject: [Bug c++/71789] atomic_int incompatibility warning between C and C++ [-Wlto-type-mismatch]
- Auto-submitted: auto-generated
- References: <bug-71789-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71789
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |lto
CC| |jason at gcc dot gnu.org,
| |jsm28 at gcc dot gnu.org
Component|middle-end |c++
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, clearly C++ atomic_int (aka atomic<int>) and C atomic_int (aka _Atomic
int)
do not inter-operate.
It might be possible that you are lucky for the x86_64 ABI but certainly
TBAA will not treat things like aggregate copies of C++ atomic_int as
possibly clobbering a C _Atomic int.
I'm not sure what standards bodies thought on this issue but it looks hard
to apply a workaround to LTO (the types would need to share TYPE_CANONICAL
which is impossible at the moment as one is a plain INTEGER_TYPE and one
is a RECORD_TYPE).