This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/69404] atomic builtins accept incompatible pointers
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 03 Feb 2016 02:40:32 +0000
- Subject: [Bug c/69404] atomic builtins accept incompatible pointers
- Auto-submitted: auto-generated
- References: <bug-69404-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69404
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2016-2-2
Known to fail| |4.9.3, 5.3.0, 6.0
--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
This bug also allows the atomic intrinsics to change the representation of
_Bool objects to other than 0 1, violating the GCC invariant. This is a
loophole that the fix bug 69404 was intended to close (and did for
__atomic_fetch_xxx) but missed for __atomic_load and __atomic_exchange. As a
result, GCC compiles the following test case without a warning:
$ cat u.c && /home/msebor/build/gcc-trunk-git/gcc/xgcc
-B/home/msebor/build/gcc-trunk-git/gcc -S -Wall -Wextra -Wpedantic -o/dev/null
u.c
void f (char *a, _Bool *b)
{
__atomic_load (a, b, 0);
}