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<mse...@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<mse...@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<mse...@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

Reply via email to