Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/814234/?format=api
{ "id": 814234, "url": "http://patchwork.ozlabs.org/api/patches/814234/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170915112802.GS1701@tucnak/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/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": "<20170915112802.GS1701@tucnak>", "list_archive_url": null, "date": "2017-09-15T11:28:02", "name": "Backports to 7.x", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a6be6caa76133a000b2923f5ac7e1882462472d3", "submitter": { "id": 671, "url": "http://patchwork.ozlabs.org/api/people/671/?format=api", "name": "Jakub Jelinek", "email": "jakub@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20170915112802.GS1701@tucnak/mbox/", "series": [ { "id": 3286, "url": "http://patchwork.ozlabs.org/api/series/3286/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=3286", "date": "2017-09-15T11:28:02", "name": "Backports to 7.x", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3286/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/814234/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/814234/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-462228-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-462228-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=\"HsC+kW0V\"; 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 3xttSP4xn6z9sPr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 21:28:19 +1000 (AEST)", "(qmail 949 invoked by alias); 15 Sep 2017 11:28:11 -0000", "(qmail 931 invoked by uid 89); 15 Sep 2017 11:28:10 -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\tFri, 15 Sep 2017 11:28:07 +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 BA075461DC\tfor\n\t<gcc-patches@gcc.gnu.org>; Fri, 15 Sep 2017 11:28:06 +0000 (UTC)", "from tucnak.zalov.cz (ovpn-116-102.ams2.redhat.com\n\t[10.36.116.102])\tby smtp.corp.redhat.com (Postfix) with\n\tESMTPS id 3A32960E3F\tfor <gcc-patches@gcc.gnu.org>;\n\tFri, 15 Sep 2017 11:28:05 +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 v8FBS3c5024022\tfor\n\t<gcc-patches@gcc.gnu.org>; Fri, 15 Sep 2017 13:28:03 +0200", "(from jakub@localhost)\tby tucnak.zalov.cz (8.15.2/8.15.2/Submit)\n\tid v8FBS22G024021\tfor gcc-patches@gcc.gnu.org;\n\tFri, 15 Sep 2017 13:28:02 +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:subject:message-id:reply-to:mime-version:content-type;\n\tq=dns; s=default; b=HKauAzOY9eum7dgBP4QYv6uatx4nZFfE13Usj2XgzP/\n\tGXDNkp/fNY51j9EW+iBYZyI5rbN08B46TPQuLK/IiLC4IHYkY1DO19FqEbqTSKFs\n\tyTekYHU7zfNRHO+O5Zs0lWyresU3ea5DhE36zRoXI8Hec/iIEXSLiEmQ8Np86P0I\n\t=", "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:subject:message-id:reply-to:mime-version:content-type;\n\ts=default; bh=y5J9hbm/KIpddHvz7+qHDtAQgHw=; b=HsC+kW0VGR8eyB1JS\n\tIVcRUCdsilUZyvz4G98nZ5xE3E50O8uJqh8T2v06lv8f6BUvvuSwnS1hMDuPdwN/\n\toLGSGyUoziBXm5Un84y4BEeimv1RQWuTdQGMHQ3IZc8ZHjiCQoTGyhYJF6C3+Cjq\n\t7jp+Z5nQEMMgWV8mq89R7X2xKA=", "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 BA075461DC", "Date": "Fri, 15 Sep 2017 13:28:02 +0200", "From": "Jakub Jelinek <jakub@redhat.com>", "To": "gcc-patches@gcc.gnu.org", "Subject": "Backports to 7.x", "Message-ID": "<20170915112802.GS1701@tucnak>", "Reply-To": "Jakub Jelinek <jakub@redhat.com>", "MIME-Version": "1.0", "Content-Type": "multipart/mixed; boundary=\"/rDaUNvWv5XYRSKj\"", "Content-Disposition": "inline", "User-Agent": "Mutt/1.7.1 (2016-10-04)", "X-IsSubscribed": "yes" }, "content": "Hi!\n\nI've bootstrapped/regtested (x86_64-linux and i686-linux) and committed following\n4 backports to gcc-7-branch:\n\n\tJakub\n2017-09-15 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-12 Jakub Jelinek <jakub@redhat.com>\n\n\tPR target/82112\n\t* c-common.c (sync_resolve_size): Instead of c_dialect_cxx ()\n\tassertion check that in the condition.\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\t* gcc.dg/pr82112.c: New test.\n2017-09-15 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-12 Jakub Jelinek <jakub@redhat.com>\n\n\tPR target/82112\n\t* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): For\n\tALTIVEC_BUILTIN_VEC_LD if arg1 has array type call default_conversion\n\ton it early, rather than manual conversion late. For\n\tALTIVEC_BUILTIN_VEC_ST if arg2 has array type call default_conversion\n\tinstead of performing manual conversion.\n\n\t* gcc.target/powerpc/pr82112.c: New test.\n\t* g++.dg/ext/altivec-18.C: New test.\n\n--- gcc/config/rs6000/rs6000-c.c\t(revision 252027)\n+++ gcc/config/rs6000/rs6000-c.c\t(revision 252028)\n@@ -6489,7 +6489,13 @@ altivec_resolve_overloaded_builtin (loca\n \n /* Strip qualifiers like \"const\" from the pointer arg. */\n tree arg1_type = TREE_TYPE (arg1);\n- if (!POINTER_TYPE_P (arg1_type) && TREE_CODE (arg1_type) != ARRAY_TYPE)\n+ if (TREE_CODE (arg1_type) == ARRAY_TYPE && c_dialect_cxx ())\n+\t{\n+\t /* Force array-to-pointer decay for C++. */\n+\t arg1 = default_conversion (arg1);\n+\t arg1_type = TREE_TYPE (arg1);\n+\t}\n+ if (!POINTER_TYPE_P (arg1_type))\n \tgoto bad;\n \n tree inner_type = TREE_TYPE (arg1_type);\n@@ -6509,15 +6515,6 @@ altivec_resolve_overloaded_builtin (loca\n \t if (!ptrofftype_p (TREE_TYPE (arg0)))\n \t arg0 = build1 (NOP_EXPR, sizetype, arg0);\n \n-\t tree arg1_type = TREE_TYPE (arg1);\n-\t if (TREE_CODE (arg1_type) == ARRAY_TYPE)\n-\t {\n-\t arg1_type = TYPE_POINTER_TO (TREE_TYPE (arg1_type));\n-\t tree const0 = build_int_cstu (sizetype, 0);\n-\t tree arg1_elt0 = build_array_ref (loc, arg1, const0);\n-\t arg1 = build1 (ADDR_EXPR, arg1_type, arg1_elt0);\n-\t }\n-\n \t tree addr = fold_build2_loc (loc, POINTER_PLUS_EXPR, arg1_type,\n \t\t\t\t arg1, arg0);\n \t tree aligned = fold_build2_loc (loc, BIT_AND_EXPR, arg1_type, addr,\n@@ -6572,12 +6569,11 @@ altivec_resolve_overloaded_builtin (loca\n \t arg1 = build1 (NOP_EXPR, sizetype, arg1);\n \n \t tree arg2_type = TREE_TYPE (arg2);\n-\t if (TREE_CODE (arg2_type) == ARRAY_TYPE)\n+\t if (TREE_CODE (arg2_type) == ARRAY_TYPE && c_dialect_cxx ())\n \t {\n-\t arg2_type = TYPE_POINTER_TO (TREE_TYPE (arg2_type));\n-\t tree const0 = build_int_cstu (sizetype, 0);\n-\t tree arg2_elt0 = build_array_ref (loc, arg2, const0);\n-\t arg2 = build1 (ADDR_EXPR, arg2_type, arg2_elt0);\n+\t /* Force array-to-pointer decay for C++. */\n+\t arg2 = default_conversion (arg2);\n+\t arg2_type = TREE_TYPE (arg2);\n \t }\n \n \t /* Find the built-in to make sure a compatible one exists; if not\n--- gcc/testsuite/gcc.target/powerpc/pr82112.c\t(nonexistent)\n+++ gcc/testsuite/gcc.target/powerpc/pr82112.c\t(revision 252028)\n@@ -0,0 +1,16 @@\n+/* PR target/82112 */\n+/* { dg-do compile } */\n+/* { dg-require-effective-target powerpc_altivec_ok } */\n+/* { dg-options \"-maltivec -std=gnu90\" } */\n+\n+#include <altivec.h>\n+\n+struct __attribute__((aligned (16))) S { unsigned char c[64]; } bar (void);\n+vector unsigned char v;\n+\n+void\n+foo (void)\n+{\n+ vec_ld (0, bar ().c);\t/* { dg-error \"invalid parameter combination for AltiVec intrinsic\" } */\n+ vec_st (v, 0, bar ().c);\t/* { dg-error \"invalid parameter combination for AltiVec intrinsic\" } */\n+}\n--- gcc/testsuite/g++.dg/ext/altivec-18.C\t(nonexistent)\n+++ gcc/testsuite/g++.dg/ext/altivec-18.C\t(revision 252028)\n@@ -0,0 +1,14 @@\n+// PR target/82112\n+// { dg-do compile { target powerpc*-*-* } }\n+// { dg-require-effective-target powerpc_altivec_ok }\n+// { dg-options \"-maltivec\" }\n+\n+#include <altivec.h>\n+\n+__attribute__((aligned (16))) extern const unsigned char c[16];\n+\n+void\n+foo (void)\n+{\n+ vec_ld (0, c);\n+}\n2017-09-15 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-14 Jakub Jelinek <jakub@redhat.com>\n \n\tPR target/81325\n\t* cfgbuild.c (find_bb_boundaries): Ignore debug insns in decisions\n\tif and where to split a bb, except for splitting before debug insn\n\tsequences followed by non-label real insn. Delete debug insns\n\tin between basic blocks.\n\n\t* g++.dg/cpp0x/pr81325.C: New test.\n\n--- gcc/cfgbuild.c\t(revision 252751)\n+++ gcc/cfgbuild.c\t(revision 252752)\n@@ -442,9 +442,10 @@ find_bb_boundaries (basic_block bb)\n rtx_insn *end = BB_END (bb), *x;\n rtx_jump_table_data *table;\n rtx_insn *flow_transfer_insn = NULL;\n+ rtx_insn *debug_insn = NULL;\n edge fallthru = NULL;\n \n- if (insn == BB_END (bb))\n+ if (insn == end)\n return;\n \n if (LABEL_P (insn))\n@@ -455,27 +456,49 @@ find_bb_boundaries (basic_block bb)\n {\n enum rtx_code code = GET_CODE (insn);\n \n+ if (code == DEBUG_INSN)\n+\t{\n+\t if (flow_transfer_insn && !debug_insn)\n+\t debug_insn = insn;\n+\t}\n /* In case we've previously seen an insn that effects a control\n \t flow transfer, split the block. */\n- if ((flow_transfer_insn || code == CODE_LABEL)\n-\t && inside_basic_block_p (insn))\n+ else if ((flow_transfer_insn || code == CODE_LABEL)\n+\t && inside_basic_block_p (insn))\n \t{\n-\t fallthru = split_block (bb, PREV_INSN (insn));\n+\t rtx_insn *prev = PREV_INSN (insn);\n+\n+\t /* If the first non-debug inside_basic_block_p insn after a control\n+\t flow transfer is not a label, split the block before the debug\n+\t insn instead of before the non-debug insn, so that the debug\n+\t insns are not lost. */\n+\t if (debug_insn && code != CODE_LABEL && code != BARRIER)\n+\t prev = PREV_INSN (debug_insn);\n+\t fallthru = split_block (bb, prev);\n \t if (flow_transfer_insn)\n \t {\n \t BB_END (bb) = flow_transfer_insn;\n \n+\t rtx_insn *next;\n \t /* Clean up the bb field for the insns between the blocks. */\n \t for (x = NEXT_INSN (flow_transfer_insn);\n \t\t x != BB_HEAD (fallthru->dest);\n-\t\t x = NEXT_INSN (x))\n-\t\tif (!BARRIER_P (x))\n-\t\t set_block_for_insn (x, NULL);\n+\t\t x = next)\n+\t\t{\n+\t\t next = NEXT_INSN (x);\n+\t\t /* Debug insns should not be in between basic blocks,\n+\t\t drop them on the floor. */\n+\t\t if (DEBUG_INSN_P (x))\n+\t\t delete_insn (x);\n+\t\t else if (!BARRIER_P (x))\n+\t\t set_block_for_insn (x, NULL);\n+\t\t}\n \t }\n \n \t bb = fallthru->dest;\n \t remove_edge (fallthru);\n \t flow_transfer_insn = NULL;\n+\t debug_insn = NULL;\n \t if (code == CODE_LABEL && LABEL_ALT_ENTRY_P (insn))\n \t make_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun), bb, 0);\n \t}\n@@ -498,17 +521,23 @@ find_bb_boundaries (basic_block bb)\n /* In case expander replaced normal insn by sequence terminating by\n return and barrier, or possibly other sequence not behaving like\n ordinary jump, we need to take care and move basic block boundary. */\n- if (flow_transfer_insn)\n+ if (flow_transfer_insn && flow_transfer_insn != end)\n {\n BB_END (bb) = flow_transfer_insn;\n \n /* Clean up the bb field for the insns that do not belong to BB. */\n- x = flow_transfer_insn;\n- while (x != end)\n+ rtx_insn *next;\n+ for (x = NEXT_INSN (flow_transfer_insn); ; x = next)\n \t{\n-\t x = NEXT_INSN (x);\n-\t if (!BARRIER_P (x))\n+\t next = NEXT_INSN (x);\n+\t /* Debug insns should not be in between basic blocks,\n+\t drop them on the floor. */\n+\t if (DEBUG_INSN_P (x))\n+\t delete_insn (x);\n+\t else if (!BARRIER_P (x))\n \t set_block_for_insn (x, NULL);\n+\t if (x == end)\n+\t break;\n \t}\n }\n \n--- gcc/testsuite/g++.dg/cpp0x/pr81325.C\t(nonexistent)\n+++ gcc/testsuite/g++.dg/cpp0x/pr81325.C\t(revision 252752)\n@@ -0,0 +1,84 @@\n+// PR target/81325\n+// { dg-do compile { target c++11 } }\n+// { dg-options \"-O2 -fcompare-debug\" }\n+\n+struct A { A(const char *, const int & = 0); };\n+template <typename> struct B;\n+template <typename> struct C {\n+ int _M_i;\n+ void m_fn1() { __atomic_fetch_add(&_M_i, 0, __ATOMIC_RELAXED); }\n+};\n+struct D {\n+ int *Data;\n+ long Length = 0;\n+ D(int) : Data() {}\n+};\n+template <> struct B<int> : C<int> {};\n+struct F {\n+ B<int> RefCount;\n+ void m_fn2() { RefCount.m_fn1(); }\n+};\n+struct G {\n+ F *Obj;\n+ G(const G &p1) : Obj(p1.Obj) {\n+ if (Obj) {\n+ F *a = 0;\n+ a->m_fn2();\n+ }\n+ }\n+};\n+struct H {\n+ int CPlusPlus : 1;\n+};\n+struct I {\n+ enum {} KindId;\n+};\n+template <typename ResultT, typename ArgT> struct J {\n+ void operator()();\n+ ResultT operator()(ArgT) {}\n+};\n+struct K {\n+ int AllowBind;\n+ I SupportedKind;\n+ I RestrictKind;\n+ G Implementation;\n+};\n+struct L {\n+ L(int) : Implementation(Implementation) {}\n+ K Implementation;\n+};\n+struct M {\n+ int Param1;\n+};\n+struct N {\n+ N(int, L &p2) : Param2(p2) {}\n+ L Param2;\n+};\n+struct O {\n+ L m_fn3();\n+};\n+L ignoringImpCasts(L);\n+J<O, L> b;\n+L hasName(const A &);\n+M hasOverloadedOperatorName(D);\n+J<O, int> c;\n+struct P {\n+ void m_fn4(L, int);\n+};\n+struct Q {\n+ void m_fn5(P *);\n+};\n+H d;\n+void Q::m_fn5(P *p1) {\n+ if (!d.CPlusPlus) {\n+ c();\n+ L e = 0, f = ignoringImpCasts(e);\n+ b(ignoringImpCasts(f)).m_fn3();\n+ }\n+ hasOverloadedOperatorName(0);\n+ hasName(\"\");\n+ L g = 0;\n+ N(0, g);\n+ L h(0);\n+ p1->m_fn4(h, 0);\n+}\n2017-09-15 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-14 Jakub Jelinek <jakub@redhat.com>\n\n\tPR c++/81314\n\t* cp-gimplify.c (omp_var_to_track): Look through references.\n\t(omp_cxx_notice_variable): Likewise.\n\n\t* testsuite/libgomp.c++/pr81314.C: New test.\n\n--- gcc/cp/cp-gimplify.c\t(revision 252769)\n+++ gcc/cp/cp-gimplify.c\t(revision 252770)\n@@ -895,6 +895,8 @@ omp_var_to_track (tree decl)\n tree type = TREE_TYPE (decl);\n if (is_invisiref_parm (decl))\n type = TREE_TYPE (type);\n+ else if (TREE_CODE (type) == REFERENCE_TYPE)\n+ type = TREE_TYPE (type);\n while (TREE_CODE (type) == ARRAY_TYPE)\n type = TREE_TYPE (type);\n if (type == error_mark_node || !CLASS_TYPE_P (type))\n@@ -947,6 +949,8 @@ omp_cxx_notice_variable (struct cp_gener\n \t tree type = TREE_TYPE (decl);\n \t if (is_invisiref_parm (decl))\n \t\ttype = TREE_TYPE (type);\n+\t else if (TREE_CODE (type) == REFERENCE_TYPE)\n+\t\ttype = TREE_TYPE (type);\n \t while (TREE_CODE (type) == ARRAY_TYPE)\n \t\ttype = TREE_TYPE (type);\n \t get_copy_ctor (type, tf_none);\n--- libgomp/testsuite/libgomp.c++/pr81314.C\t(nonexistent)\n+++ libgomp/testsuite/libgomp.c++/pr81314.C\t(revision 252770)\n@@ -0,0 +1,38 @@\n+// PR c++/81314\n+// { dg-do link }\n+\n+template <int N>\n+struct S {\n+ S () { s = 0; }\n+ S (const S &x) { s = x.s; }\n+ ~S () {}\n+ int s;\n+};\n+\n+void\n+foo (S<2> &x)\n+{\n+ #pragma omp taskloop\n+ for (int i = 0; i < 100; ++i)\n+ x.s++;\n+}\n+\n+void\n+bar (S<3> &x)\n+{\n+ #pragma omp task\n+ x.s++;\n+}\n+\n+int\n+main ()\n+{\n+ S<2> s;\n+ S<3> t;\n+ #pragma omp parallel\n+ #pragma omp master\n+ {\n+ foo (s);\n+ bar (t);\n+ }\n+}", "diff": "--- gcc/c-family/c-common.c\t(revision 252002)\n+++ gcc/c-family/c-common.c\t(revision 252003)\n@@ -6478,10 +6478,9 @@ sync_resolve_size (tree function, vec<tr\n }\n \n argtype = type = TREE_TYPE ((*params)[0]);\n- if (TREE_CODE (type) == ARRAY_TYPE)\n+ if (TREE_CODE (type) == ARRAY_TYPE && c_dialect_cxx ())\n {\n /* Force array-to-pointer decay for C++. */\n- gcc_assert (c_dialect_cxx());\n (*params)[0] = default_conversion ((*params)[0]);\n type = TREE_TYPE ((*params)[0]);\n }\n@@ -6646,10 +6645,9 @@ get_atomic_generic_size (location_t loc,\n \n /* Get type of first parameter, and determine its size. */\n type_0 = TREE_TYPE ((*params)[0]);\n- if (TREE_CODE (type_0) == ARRAY_TYPE)\n+ if (TREE_CODE (type_0) == ARRAY_TYPE && c_dialect_cxx ())\n {\n /* Force array-to-pointer decay for C++. */\n- gcc_assert (c_dialect_cxx());\n (*params)[0] = default_conversion ((*params)[0]);\n type_0 = TREE_TYPE ((*params)[0]);\n }\n@@ -6688,6 +6686,12 @@ 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 && c_dialect_cxx ())\n+\t{\n+\t /* Force array-to-pointer decay for C++. */\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/gcc.dg/pr82112.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/pr82112.c\t(revision 252003)\n@@ -0,0 +1,21 @@\n+/* PR target/82112 */\n+/* { dg-do compile } */\n+/* { dg-options \"-std=gnu90\" } */\n+\n+struct S { int a[10]; } bar (void);\n+int b, c;\n+\n+void\n+foo (void)\n+{\n+ __atomic_load (bar ().a, &b, __ATOMIC_ACQUIRE);\t/* { dg-error \"argument 1 of .__atomic_load. must be a non-void pointer type\" } */\n+ __atomic_load (&b, bar ().a, __ATOMIC_ACQUIRE);\t/* { dg-error \"argument 2 of .__atomic_load. must be a pointer type\" } */\n+ __atomic_store (bar ().a, &b, __ATOMIC_SEQ_CST);\t/* { dg-error \"argument 1 of .__atomic_store. must be a non-void pointer type\" } */\n+ __atomic_store (&b, bar ().a, __ATOMIC_SEQ_CST);\t/* { dg-error \"argument 2 of .__atomic_store. must be a pointer type\" } */\n+ __atomic_exchange (bar ().a, &b, &c, __ATOMIC_RELAXED);\t/* { dg-error \"argument 1 of .__atomic_exchange. must be a non-void pointer type\" } */\n+ __atomic_exchange (&b, bar ().a, &c, __ATOMIC_RELAXED);\t/* { dg-error \"argument 2 of .__atomic_exchange. must be a pointer type\" } */\n+ __atomic_exchange (&b, &c, bar ().a, __ATOMIC_RELAXED);\t/* { dg-error \"argument 3 of .__atomic_exchange. must be a pointer type\" } */\n+ __atomic_compare_exchange (bar ().a, &b, &c, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);\t/* { dg-error \"argument 1 of .__atomic_compare_exchange. must be a non-void pointer type\" } */\n+ __atomic_compare_exchange (&b, bar ().a, &c, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);\t/* { dg-error \"argument 2 of .__atomic_compare_exchange. must be a pointer type\" } */\n+ __atomic_compare_exchange (&b, &c, bar ().a, 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED);\t/* { dg-error \"argument 3 of .__atomic_compare_exchange. must be a pointer type\" } */\n+}\n--- gcc/testsuite/c-c++-common/pr82112.c\t(nonexistent)\n+++ gcc/testsuite/c-c++-common/pr82112.c\t(revision 252003)\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": [] }