This is the mail archive of the gcc-patches@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]

Re: [PATCH] c/68966 - atomic_fetch_* on atomic_bool not diagnosed


On 12/22/2015 09:46 PM, Martin Sebor wrote:
The attached patch rejects invocations of atomic fetch_op intrinsics
on objects of _Bool type as discussed in the context of PR c/68908.

Tested on x86_64.

Martin

gcc-68966.patch


gcc/testsuite/ChangeLog:
2015-12-22  Martin Sebor<msebor@redhat.com>

	PR c/68966
	* gcc.dg/atomic-fetch-bool.c: New test.
	* gcc.dg/sync-fetch-bool.c: Same.

gcc/ChangeLog:
2015-12-22  Martin Sebor<msebor@redhat.com>

	PR c/68966
	* doc/extend.texi (__atomic Builtins, __sync Builtins): Document
	constraint on the type of arguments.

gcc/c-family/ChangeLog:
2015-12-22  Martin Sebor<msebor@redhat.com>

	PR c/68966
	* c-common.c (sync_resolve_size): Reject first argument when it's
	a pointer to _Bool.

Index: gcc/c-family/c-common.c
===================================================================
--- gcc/c-family/c-common.c	(revision 231903)
+++ gcc/c-family/c-common.c	(working copy)
@@ -7667,6 +7667,6 @@

    if (error_operand_p (align))
      return -1;
    if (TREE_CODE (align) != INTEGER_CST
        || !INTEGRAL_TYPE_P (TREE_TYPE (align)))
      {
No changes in this hunk. I assume you hand-edited the patch to remove something that you really didn't intend to submit and left the above useless hunk.

The patch itself is fine for the trunk.

Thanks,
Jeff


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