Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/810913/?format=api
{ "id": 810913, "url": "http://patchwork.ozlabs.org/api/1.2/patches/810913/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170907084344.GT2323@tucnak/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.2/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170907084344.GT2323@tucnak>", "list_archive_url": null, "date": "2017-09-07T08:43:44", "name": "Fix atomic builtins on arrays (PR target/82112)", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a82129a6a0cab01a6406fbd602a4730b3ee5b479", "submitter": { "id": 671, "url": "http://patchwork.ozlabs.org/api/1.2/people/671/?format=api", "name": "Jakub Jelinek", "email": "jakub@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20170907084344.GT2323@tucnak/mbox/", "series": [ { "id": 1947, "url": "http://patchwork.ozlabs.org/api/1.2/series/1947/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=1947", "date": "2017-09-07T08:43:44", "name": "Fix atomic builtins on arrays (PR target/82112)", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1947/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810913/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810913/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-461663-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461663-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"S72xCLn2\"; dkim-atps=neutral", "sourceware.org; auth=none", "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jakub@redhat.com" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnvBl2gkwz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 7 Sep 2017 18:44:15 +1000 (AEST)", "(qmail 42985 invoked by alias); 7 Sep 2017 08:44:05 -0000", "(qmail 40253 invoked by uid 89); 7 Sep 2017 08:44:00 -0000", "from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tThu, 07 Sep 2017 08:43:55 +0000", "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com\n\t[10.5.11.12])\t(using TLSv1.2 with cipher AECDH-AES256-SHA\n\t(256/256 bits))\t(No client certificate requested)\tby\n\tmx1.redhat.com (Postfix) with ESMTPS id 6FA64550B0;\n\tThu, 7 Sep 2017 08:43:54 +0000 (UTC)", "from tucnak.zalov.cz (ovpn-116-33.ams2.redhat.com\n\t[10.36.116.33])\tby smtp.corp.redhat.com (Postfix) with ESMTPS\n\tid 866B218BA3; Thu, 7 Sep 2017 08:43:50 +0000 (UTC)", "from tucnak.zalov.cz (localhost [127.0.0.1])\tby tucnak.zalov.cz\n\t(8.15.2/8.15.2) with ESMTP id v878hjpq014587;\n\tThu, 7 Sep 2017 10:43:46 +0200", "(from jakub@localhost)\tby tucnak.zalov.cz (8.15.2/8.15.2/Submit)\n\tid v878hilC014586; Thu, 7 Sep 2017 10:43:44 +0200" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:reply-to:mime-version\n\t:content-type; q=dns; s=default; b=uCQrhOXtY+Ogg74xHWZp7H3xH0a8s\n\tVIJ6rhhEQpsU4JGy5Ef75prHJzyWo0kNiuVsdKO65Fv24stKEesyjf4SnptgOQOr\n\tsAl+Rngnv5bpJ6fZugApJZE1z2hcXFvGmyCMKU3C3bxB/VqUS5XhnOdVdDEozH7e\n\tc0KQf6AcaI0xW4=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:reply-to:mime-version\n\t:content-type; s=default; bh=xqOF0bwiObK+fs1rikuPIofKwHA=; b=S72\n\txCLn2Dy1ZQX6D/WkWNTWqj2soDCmKznmne8uuvWGb+A3mFxRPPXnjpQA8wZOSNpt\n\t0CyVzwIShRAazDDMZLHwBRXj+cQ85AWD3S17pY+OmuYwWGP1PNpIP+zYmjJLUKVF\n\tOWFdjyLSUtvP/P11olzn3lxADjfrRz2VV4/HLPWQ=", "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>", "Sender": "gcc-patches-owner@gcc.gnu.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2,\n\tGIT_PATCH_3, RP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=ham version=3.3.2 spammy=", "X-HELO": "mx1.redhat.com", "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 6FA64550B0", "Date": "Thu, 7 Sep 2017 10:43:44 +0200", "From": "Jakub Jelinek <jakub@redhat.com>", "To": "\"Joseph S. Myers\" <joseph@codesourcery.com>,\n\tMarek Polacek <polacek@redhat.com>, Jason Merrill <jason@redhat.com>", "Cc": "gcc-patches@gcc.gnu.org", "Subject": "[PATCH] Fix atomic builtins on arrays (PR target/82112)", "Message-ID": "<20170907084344.GT2323@tucnak>", "Reply-To": "Jakub Jelinek <jakub@redhat.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "User-Agent": "Mutt/1.7.1 (2016-10-04)", "X-IsSubscribed": "yes" }, "content": "Hi!\n\nThe powerpc patch I've just posted led me to try __atomic_* builtins\non arrays as in the testcase below. While it works fine if the\narray is just on the first argument or in C, in C++ for arrays in 2nd\nor 3rd argument the atomics are rejected (complaining that the argument\nis not a pointer), while we should really have performed array-to-pointer\nconversion first.\n\nFixed thusly, bootstrapped/regtested on powerpc64-linux, ok for trunk?\n\n2017-09-07 Jakub Jelinek <jakub@redhat.com>\n\n\tPR target/82112\n\t* c-common.c (sync_resolve_size): Formatting fix.\n\t(get_atomic_generic_size): Likewise. Before testing if parameter\n\thas pointer type, if it has array type, call for C++\n\tdefault_conversion to perform array-to-pointer conversion.\n\n\t* c-c++-common/pr82112.c: New test.\n\n\n\tJakub", "diff": "--- gcc/c-family/c-common.c.jj\t2017-09-01 09:25:35.000000000 +0200\n+++ gcc/c-family/c-common.c\t2017-09-06 14:47:11.781523252 +0200\n@@ -6481,7 +6481,7 @@ sync_resolve_size (tree function, vec<tr\n if (TREE_CODE (type) == ARRAY_TYPE)\n {\n /* Force array-to-pointer decay for C++. */\n- gcc_assert (c_dialect_cxx());\n+ gcc_assert (c_dialect_cxx ());\n (*params)[0] = default_conversion ((*params)[0]);\n type = TREE_TYPE ((*params)[0]);\n }\n@@ -6649,7 +6649,7 @@ get_atomic_generic_size (location_t loc,\n if (TREE_CODE (type_0) == ARRAY_TYPE)\n {\n /* Force array-to-pointer decay for C++. */\n- gcc_assert (c_dialect_cxx());\n+ gcc_assert (c_dialect_cxx ());\n (*params)[0] = default_conversion ((*params)[0]);\n type_0 = TREE_TYPE ((*params)[0]);\n }\n@@ -6688,6 +6688,13 @@ get_atomic_generic_size (location_t loc,\n /* __atomic_compare_exchange has a bool in the 4th position, skip it. */\n if (n_param == 6 && x == 3)\n continue;\n+ if (TREE_CODE (type) == ARRAY_TYPE)\n+\t{\n+\t /* Force array-to-pointer decay for C++. */\n+\t gcc_assert (c_dialect_cxx ());\n+\t (*params)[x] = default_conversion ((*params)[x]);\n+\t type = TREE_TYPE ((*params)[x]);\n+\t}\n if (!POINTER_TYPE_P (type))\n \t{\n \t error_at (loc, \"argument %d of %qE must be a pointer type\", x + 1,\n--- gcc/testsuite/c-c++-common/pr82112.c.jj\t2017-09-06 15:21:06.720336134 +0200\n+++ gcc/testsuite/c-c++-common/pr82112.c\t2017-09-06 15:21:25.138116835 +0200\n@@ -0,0 +1,13 @@\n+/* PR target/82112 */\n+/* { dg-do compile } */\n+\n+int c[10], d[10], e[10], f[10], g[10], h[10], i[10], j[10], k[10], l[10];\n+\n+void\n+foo (void)\n+{\n+ __atomic_load (c, d, __ATOMIC_ACQUIRE);\n+ __atomic_store (e, f, __ATOMIC_SEQ_CST);\n+ __atomic_exchange (g, h, i, __ATOMIC_RELAXED);\n+ __atomic_compare_exchange (j, k, l, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);\n+}\n", "prefixes": [] }