Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/814540/?format=api
{ "id": 814540, "url": "http://patchwork.ozlabs.org/api/patches/814540/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170916185232.GB1701@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": "<20170916185232.GB1701@tucnak>", "list_archive_url": null, "date": "2017-09-16T18:52:32", "name": "Backports to 5.x", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "197b45f5fee9b66f42f5c86428429831318d31f5", "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/20170916185232.GB1701@tucnak/mbox/", "series": [ { "id": 3465, "url": "http://patchwork.ozlabs.org/api/series/3465/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=3465", "date": "2017-09-16T18:52:32", "name": "Backports to 5.x", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3465/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/814540/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/814540/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-462312-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-462312-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=\"vsTMSRSJ\"; dkim-atps=neutral", "sourceware.org; auth=none", "ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx03.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 3xvhGw21M2z9s7v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 04:52:55 +1000 (AEST)", "(qmail 115150 invoked by alias); 16 Sep 2017 18:52:42 -0000", "(qmail 114075 invoked by uid 89); 16 Sep 2017 18:52:42 -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\tSat, 16 Sep 2017 18:52:38 +0000", "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com\n\t[10.5.11.15])\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 EF4C77E431\tfor\n\t<gcc-patches@gcc.gnu.org>; Sat, 16 Sep 2017 18:52:36 +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 6C9025D6A5\tfor <gcc-patches@gcc.gnu.org>;\n\tSat, 16 Sep 2017 18:52:36 +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 v8GIqXuT024307\tfor\n\t<gcc-patches@gcc.gnu.org>; Sat, 16 Sep 2017 20:52:34 +0200", "(from jakub@localhost)\tby tucnak.zalov.cz (8.15.2/8.15.2/Submit)\n\tid v8GIqWvZ024306\tfor gcc-patches@gcc.gnu.org;\n\tSat, 16 Sep 2017 20:52:32 +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=O+BmjCxLTO9jgybVVHi4fu31Z8aEZYAuiuLzRsHPD/u\n\tXlZYrSGL/wNuKbWAoRtYCrFDmHkdjBQUOXkXynV73Br1DLPSovs1pLH6Y2/9ADcq\n\txWzdb6CbscpMWDj1rpUidfYm3SUKXRdq8DsPzmf2GaMl30jOk987F5RE/xwtUgTc\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=WyGpJWII0m88E/gsqRNgl+TBsjE=; b=vsTMSRSJiYZX1IXbi\n\tfOsgs1KinN4Xpx/OCpA66G76yh4xtATbkCyshSZaJ2Iy/dfFRApi50A60qvEmZ9u\n\tdPRxbWRg70a/0+HBV0V0spmnW4IQRBrbcEIprK7RxHGo4wWjYMJ7T1DEe5v8wF4T\n\thPeHPYbCm3EnscOl7Mw/s5tpFI=", "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 EF4C77E431", "Date": "Sat, 16 Sep 2017 20:52:32 +0200", "From": "Jakub Jelinek <jakub@redhat.com>", "To": "gcc-patches@gcc.gnu.org", "Subject": "Backports to 5.x", "Message-ID": "<20170916185232.GB1701@tucnak>", "Reply-To": "Jakub Jelinek <jakub@redhat.com>", "MIME-Version": "1.0", "Content-Type": "multipart/mixed; boundary=\"bZ2MuwyI/0uB8yuJ\"", "Content-Disposition": "inline", "User-Agent": "Mutt/1.7.1 (2016-10-04)", "X-IsSubscribed": "yes" }, "content": "Hi!\n\nI've backported following patches to 5.x, bootstrapped/regtested them on\nx86_64-linux and i686-linux and committed.\n\n\tJakub\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-06-21 Jakub Jelinek <jakub@redhat.com>\n\n\tPR c++/81154\n\t* semantics.c (handle_omp_array_sections_1, finish_omp_clauses):\n\tComplain about t not being a variable if t is OVERLOAD even\n\twhen processing_template_decl.\n\n\t* g++.dg/gomp/pr81154.C: New test.\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-06-13 Jakub Jelinek <jakub@redhat.com>\n\n\tPR c++/80984\n\t* cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in\n\tBLOCK_VARS (outer) chain.\n\t(cxx_omp_const_qual_no_mutable): Likewise.\n\n\t* g++.dg/opt/nrv18.C: New test.\n\n--- gcc/cp/cp-gimplify.c\t(revision 249508)\n+++ gcc/cp/cp-gimplify.c\t(revision 249509)\n@@ -1566,7 +1566,8 @@ cp_genericize (tree fndecl)\n \n \t if (outer)\n \t for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var))\n-\t if (DECL_NAME (t) == DECL_NAME (var)\n+\t if (VAR_P (var)\n+\t\t && DECL_NAME (t) == DECL_NAME (var)\n \t\t && DECL_HAS_VALUE_EXPR_P (var)\n \t\t && DECL_VALUE_EXPR (var) == t)\n \t\t{\n@@ -1813,7 +1814,8 @@ cxx_omp_const_qual_no_mutable (tree decl\n \n \t if (outer)\n \t for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var))\n-\t if (DECL_NAME (decl) == DECL_NAME (var)\n+\t if (VAR_P (var)\n+\t\t && DECL_NAME (decl) == DECL_NAME (var)\n \t\t && (TYPE_MAIN_VARIANT (type)\n \t\t == TYPE_MAIN_VARIANT (TREE_TYPE (var))))\n \t\t{\n--- gcc/testsuite/g++.dg/opt/nrv18.C\t(nonexistent)\n+++ gcc/testsuite/g++.dg/opt/nrv18.C\t(revision 249509)\n@@ -0,0 +1,12 @@\n+// PR c++/80984\n+// { dg-do compile }\n+\n+struct A { ~A (); };\n+\n+A\n+foo ()\n+{\n+ A a;\n+a:\n+ return a;\n+}\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tPR libquadmath/65757\n\t* math/roundq.c: Cherry-pick upstream glibc 2015-04-28 change.\n\n--- libquadmath/math/roundq.c\t(revision 250378)\n+++ libquadmath/math/roundq.c\t(revision 250379)\n@@ -1,5 +1,5 @@\n /* Round __float128 to integer away from zero.\n- Copyright (C) 1997, 1999 Free Software Foundation, Inc.\n+ Copyright (C) 1997-2017 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and\n \t\t Jakub Jelinek <jj@ultra.linux.cz>, 1999.\n@@ -32,7 +32,7 @@ roundq (__float128 x)\n \n GET_FLT128_WORDS64 (i0, i1, x);\n j0 = ((i0 >> 48) & 0x7fff) - 0x3fff;\n- if (j0 < 31)\n+ if (j0 < 48)\n {\n if (j0 < 0)\n \t{\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-08-08 Richard Biener <rguenther@suse.de>\n\n\tPR middle-end/81766\n\t* function.c (thread_prologue_and_epilogue_insns): Restore\n\tbehavior of always calling find_many_sub_basic_blocks on\n\tthe inserted prologue.\n\n\t* gcc.target/i386/pr81766.c: New testcase.\n\n\t2017-08-02 Jakub Jelinek <jakub@redhat.com>\n\n\tPR middle-end/79499\n\t* function.c (thread_prologue_and_epilogue_insns): Determine blocks\n\tfor find_many_sub_basic_blocks bitmap by looking up BLOCK_FOR_INSN\n\tof first NONDEBUG_INSN_P in each of the split_prologue_seq and\n\tprologue_seq sequences - if any.\n\n\t* gcc.dg/pr79499.c: New test.\n\n--- gcc/function.c\t(revision 250814)\n+++ gcc/function.c\t(revision 250958)\n@@ -6068,13 +6068,19 @@ thread_prologue_and_epilogue_insns (void\n \n try_shrink_wrapping (&entry_edge, &bb_flags, prologue_seq);\n \n+ rtx_insn *split_prologue_insn = split_prologue_seq;\n if (split_prologue_seq != NULL_RTX)\n {\n+ while (split_prologue_insn && !NONDEBUG_INSN_P (split_prologue_insn))\n+\tsplit_prologue_insn = NEXT_INSN (split_prologue_insn);\n insert_insn_on_edge (split_prologue_seq, orig_entry_edge);\n inserted = true;\n }\n+ rtx_insn *prologue_insn = prologue_seq;\n if (prologue_seq != NULL_RTX)\n {\n+ while (prologue_insn && !NONDEBUG_INSN_P (prologue_insn))\n+\tprologue_insn = NEXT_INSN (prologue_insn);\n insert_insn_on_edge (prologue_seq, entry_edge);\n inserted = true;\n }\n@@ -6215,8 +6221,19 @@ epilogue_done:\n commit_edge_insertions ();\n \n /* Look for basic blocks within the prologue insns. */\n+ if (split_prologue_insn\n+\t && BLOCK_FOR_INSN (split_prologue_insn) == NULL)\n+\tsplit_prologue_insn = NULL;\n+ if (prologue_insn\n+\t && BLOCK_FOR_INSN (prologue_insn) == NULL)\n+\tprologue_insn = NULL;\n blocks = sbitmap_alloc (last_basic_block_for_fn (cfun));\n bitmap_clear (blocks);\n+ if (split_prologue_insn)\n+\tbitmap_set_bit (blocks,\n+\t\t\tBLOCK_FOR_INSN (split_prologue_insn)->index);\n+ if (prologue_insn)\n+\tbitmap_set_bit (blocks, BLOCK_FOR_INSN (prologue_insn)->index);\n bitmap_set_bit (blocks, entry_edge->dest->index);\n bitmap_set_bit (blocks, orig_entry_edge->dest->index);\n find_many_sub_basic_blocks (blocks);\n--- gcc/testsuite/gcc.dg/pr79499.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/pr79499.c\t(revision 250815)\n@@ -0,0 +1,13 @@\n+/* PR middle-end/79499 */\n+/* { dg-do compile { target split_stack } } */\n+/* { dg-options \"-O2 -fsplit-stack -fno-omit-frame-pointer\" } */\n+\n+struct S { struct S *a, *b; };\n+\n+void\n+foo (struct S *x)\n+{\n+ do\n+ x->b = x->a;\n+ while (x = x->a);\n+}\n--- gcc/testsuite/gcc.target/i386/pr81766.c\t(nonexistent)\n+++ gcc/testsuite/gcc.target/i386/pr81766.c\t(revision 250958)\n@@ -0,0 +1,5 @@\n+/* { dg-do compile } */\n+/* { dg-require-effective-target lp64 } */\n+/* { dg-options \"-O2 -fPIE -mcmodel=large\" } */\n+\n+int main() { return 0; }\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-07-27 Jakub Jelinek <jakub@redhat.com>\n\n\tPR c/45784\n\t* c-omp.c (c_finish_omp_for): If the condition is wrapped in\n\trhs of COMPOUND_EXPR(s), skip them and readd their lhs into\n\tnew COMPOUND_EXPRs around the rhs of the comparison.\n\n\t* testsuite/libgomp.c/pr45784.c: New test.\n\t* testsuite/libgomp.c++/pr45784.C: New test.\n\n--- gcc/c-family/c-omp.c\t(revision 251847)\n+++ gcc/c-family/c-omp.c\t(revision 251848)\n@@ -531,6 +531,12 @@ c_finish_omp_for (location_t locus, enum\n \t{\n \t bool cond_ok = false;\n \n+\t /* E.g. C sizeof (vla) could add COMPOUND_EXPRs with\n+\t evaluation of the vla VAR_DECL. We need to readd\n+\t them to the non-decl operand. See PR45784. */\n+\t while (TREE_CODE (cond) == COMPOUND_EXPR)\n+\t cond = TREE_OPERAND (cond, 1);\n+\n \t if (EXPR_HAS_LOCATION (cond))\n \t elocus = EXPR_LOCATION (cond);\n \n@@ -605,6 +611,21 @@ c_finish_omp_for (location_t locus, enum\n \t\t else if (code != CILK_SIMD && code != CILK_FOR)\n \t\t cond_ok = false;\n \t\t}\n+\n+\t if (cond_ok && TREE_VEC_ELT (condv, i) != cond)\n+\t\t{\n+\t\t tree ce = NULL_TREE, *pce = &ce;\n+\t\t tree type = TREE_TYPE (TREE_OPERAND (cond, 1));\n+\t\t for (tree c = TREE_VEC_ELT (condv, i); c != cond;\n+\t\t c = TREE_OPERAND (c, 1))\n+\t\t {\n+\t\t *pce = build2 (COMPOUND_EXPR, type, TREE_OPERAND (c, 0),\n+\t\t\t\t TREE_OPERAND (cond, 1));\n+\t\t pce = &TREE_OPERAND (*pce, 1);\n+\t\t }\n+\t\t TREE_OPERAND (cond, 1) = ce;\n+\t\t TREE_VEC_ELT (condv, i) = cond;\n+\t\t}\n \t }\n \n \t if (!cond_ok)\n--- libgomp/testsuite/libgomp.c/pr45784.c\t(nonexistent)\n+++ libgomp/testsuite/libgomp.c/pr45784.c\t(revision 251848)\n@@ -0,0 +1,41 @@\n+/* PR c/45784 */\n+/* { dg-do run } */\n+\n+void\n+foo (int n)\n+{\n+ char *p, vla[2 * n];\n+ int i;\n+ #pragma omp parallel for\n+ for (p = vla; p < vla + (sizeof (vla) / sizeof (vla[0])); p++)\n+ *p = ' ';\n+ #pragma omp parallel for\n+ for (i = 0; i < 2 * n; i++)\n+ if (vla[i] != ' ')\n+ __builtin_abort ();\n+}\n+\n+void\n+bar (int n)\n+{\n+ char *p, vla1[n], vla2[n * 2], vla3[n * 3], vla4[n * 4];\n+ int i;\n+ __builtin_memset (vla4, ' ', n * 4);\n+ #pragma omp parallel for\n+ for (p = vla4 + sizeof (vla1); p < vla4 + sizeof (vla3) - sizeof (vla2) + sizeof (vla1); p += sizeof (vla4) / sizeof (vla4))\n+ p[0] = '!';\n+ #pragma omp parallel for\n+ for (i = 0; i < n * 4; i++)\n+ if (vla4[i] != ((i >= n && i < 2 * n) ? '!' : ' '))\n+ __builtin_abort ();\n+}\n+\n+int\n+main ()\n+{\n+ volatile int n;\n+ n = 128;\n+ foo (n);\n+ bar (n);\n+ return 0;\n+}\n--- libgomp/testsuite/libgomp.c++/pr45784.C\t(nonexistent)\n+++ libgomp/testsuite/libgomp.c++/pr45784.C\t(revision 251848)\n@@ -0,0 +1,5 @@\n+// PR c/45784\n+// { dg-do run }\n+\n+#include \"../libgomp.c/pr45784.c\"\n+\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-08-03 Jakub Jelinek <jakub@redhat.com>\n\n\tPR middle-end/81052\n\t* omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp.\n\t(pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd.\n\n\t* c-c++-common/pr81052.c: New test.\n\n--- gcc/omp-low.c\t(revision 251848)\n+++ gcc/omp-low.c\t(revision 251849)\n@@ -9089,7 +9089,7 @@ diagnose_sb_0 (gimple_stmt_iterator *gsi\n }\n if (kind == NULL)\n {\n- gcc_checking_assert (flag_openmp);\n+ gcc_checking_assert (flag_openmp || flag_openmp_simd);\n kind = \"OpenMP\";\n }\n \n@@ -9349,7 +9349,7 @@ public:\n /* opt_pass methods: */\n virtual bool gate (function *)\n {\n- return flag_cilkplus || flag_openacc || flag_openmp;\n+ return flag_cilkplus || flag_openacc || flag_openmp || flag_openmp_simd;\n }\n virtual unsigned int execute (function *)\n {\n--- gcc/testsuite/c-c++-common/pr81052.c\t(nonexistent)\n+++ gcc/testsuite/c-c++-common/pr81052.c\t(revision 251849)\n@@ -0,0 +1,28 @@\n+/* PR middle-end/81052 */\n+/* { dg-do compile } */\n+/* { dg-options \"-fopenmp-simd -O2\" } */\n+\n+int\n+foo (int x, int y)\n+{\n+ int i;\n+#pragma omp simd\n+ for (i = x; i < y; ++i)\n+ return 0;\t\t\t/* { dg-error \"invalid branch to/from OpenMP structured block\" } */\n+ return 1;\n+}\n+\n+#ifdef __cplusplus\n+template <typename T>\n+T\n+bar (T x, T y)\n+{\n+ T i;\n+#pragma omp simd\n+ for (i = x; i < y; ++i)\n+ return 0;\t\t\t/* { dg-error \"invalid branch to/from OpenMP structured block\" \"\" { target c++ } } */\n+ return 1;\n+}\n+\n+int x = bar (1, 7);\n+#endif\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-08-03 Jakub Jelinek <jakub@redhat.com>\n\n\tPR target/81621\n\t* bb-reorder.c (pass_partition_blocks::execute): Return TODO_df_finish\n\tafter setting changeable df flags.\n\n\t* gcc.dg/pr81621.c: New test.\n\n--- gcc/bb-reorder.c\t(revision 251850)\n+++ gcc/bb-reorder.c\t(revision 251851)\n@@ -2881,7 +2881,8 @@ pass_partition_blocks::execute (function\n \n crossing_edges = find_rarely_executed_basic_blocks_and_crossing_edges ();\n if (!crossing_edges.exists ())\n- return 0;\n+ /* Make sure to process deferred rescans and clear changeable df flags. */\n+ return TODO_df_finish;\n \n crtl->has_bb_partition = true;\n \n@@ -2947,7 +2948,8 @@ pass_partition_blocks::execute (function\n df_analyze ();\n }\n \n- return 0;\n+ /* Make sure to process deferred rescans and clear changeable df flags. */\n+ return TODO_df_finish;\n }\n \n } // anon namespace\n--- gcc/testsuite/gcc.dg/pr81621.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/pr81621.c\t(revision 251851)\n@@ -0,0 +1,5 @@\n+/* PR target/81621 */\n+/* { dg-do compile { target freorder } } */\n+/* { dg-options \"-Og -fno-split-wide-types -freorder-blocks-and-partition\" } */\n+\n+#include \"graphite/scop-10.c\"\n2017-09-16 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-08-09 Jakub Jelinek <jakub@redhat.com>\n\n\tPR c/81687\n\t* omp-low.c (omp_copy_decl): Don't remap FORCED_LABEL or DECL_NONLOCAL\n\tLABEL_DECLs.\n\t* tree-cfg.c (move_stmt_op): Don't adjust DECL_CONTEXT of FORCED_LABEL\n\tor DECL_NONLOCAL labels.\n\t(move_stmt_r) <case GIMPLE_LABEL>: Adjust DECL_CONTEXT of FORCED_LABEL\n\tor DECL_NONLOCAL labels here.\n\n\t* testsuite/libgomp.c/pr81687-1.c: New test.\n\t* testsuite/libgomp.c/pr81687-2.c: New test.\n\n--- gcc/omp-low.c\t(revision 251852)\n+++ gcc/omp-low.c\t(revision 251853)\n@@ -800,6 +800,8 @@ omp_copy_decl (tree var, copy_body_data\n \n if (TREE_CODE (var) == LABEL_DECL)\n {\n+ if (FORCED_LABEL (var) || DECL_NONLOCAL (var))\n+\treturn var;\n new_var = create_artificial_label (DECL_SOURCE_LOCATION (var));\n DECL_CONTEXT (new_var) = current_function_decl;\n insert_decl_map (&ctx->cb, var, new_var);\n--- gcc/tree-cfg.c\t(revision 251852)\n+++ gcc/tree-cfg.c\t(revision 251853)\n@@ -6667,7 +6667,15 @@ move_stmt_op (tree *tp, int *walk_subtre\n \t\t*tp = t = out->to;\n \t }\n \n-\t DECL_CONTEXT (t) = p->to_context;\n+\t /* For FORCED_LABELs we can end up with references from other\n+\t functions if some SESE regions are outlined. It is UB to\n+\t jump in between them, but they could be used just for printing\n+\t addresses etc. In that case, DECL_CONTEXT on the label should\n+\t be the function containing the glabel stmt with that LABEL_DECL,\n+\t rather than whatever function a reference to the label was seen\n+\t last time. */\n+\t if (!FORCED_LABEL (t) && !DECL_NONLOCAL (t))\n+\t DECL_CONTEXT (t) = p->to_context;\n \t}\n else if (p->remap_decls_p)\n \t{\n@@ -6785,6 +6793,21 @@ move_stmt_r (gimple_stmt_iterator *gsi_p\n case GIMPLE_OMP_RETURN:\n case GIMPLE_OMP_CONTINUE:\n break;\n+\n+ case GIMPLE_LABEL:\n+ {\n+\t/* For FORCED_LABEL, move_stmt_op doesn't adjust DECL_CONTEXT,\n+\t so that such labels can be referenced from other regions.\n+\t Make sure to update it when seeing a GIMPLE_LABEL though,\n+\t that is the owner of the label. */\n+\twalk_gimple_op (stmt, move_stmt_op, wi);\n+\t*handled_ops_p = true;\n+\ttree label = gimple_label_label (as_a <glabel *> (stmt));\n+\tif (FORCED_LABEL (label) || DECL_NONLOCAL (label))\n+\t DECL_CONTEXT (label) = p->to_context;\n+ }\n+ break;\n+\n default:\n if (is_gimple_omp (stmt))\n \t{\n--- libgomp/testsuite/libgomp.c/pr81687-1.c\t(nonexistent)\n+++ libgomp/testsuite/libgomp.c/pr81687-1.c\t(revision 251853)\n@@ -0,0 +1,23 @@\n+/* PR c/81687 */\n+/* { dg-do link } */\n+/* { dg-additional-options \"-O2\" } */\n+\n+extern int printf (const char *, ...);\n+\n+int\n+main ()\n+{\n+ #pragma omp parallel\n+ {\n+ lab1:\n+ printf (\"lab1=%p\\n\", (void *)(&&lab1));\n+ }\n+ lab2:\n+ #pragma omp parallel\n+ {\n+ lab3:\n+ printf (\"lab2=%p\\n\", (void *)(&&lab2));\n+ }\n+ printf (\"lab3=%p\\n\", (void *)(&&lab3));\n+ return 0;\n+}\n--- libgomp/testsuite/libgomp.c/pr81687-2.c\t(nonexistent)\n+++ libgomp/testsuite/libgomp.c/pr81687-2.c\t(revision 251853)\n@@ -0,0 +1,27 @@\n+/* PR c/81687 */\n+/* { dg-do link } */\n+/* { dg-additional-options \"-O2\" } */\n+\n+int\n+main ()\n+{\n+ __label__ lab4, lab5, lab6;\n+ volatile int l = 0;\n+ int m = l;\n+ void foo (int x) { if (x == 1) goto lab4; }\n+ void bar (int x) { if (x == 2) goto lab5; }\n+ void baz (int x) { if (x == 3) goto lab6; }\n+ #pragma omp parallel\n+ {\n+ foo (m + 1);\n+ lab4:;\n+ }\n+ #pragma omp task\n+ {\n+ bar (m + 2);\n+ lab5:;\n+ }\n+ baz (m + 3);\n+ lab6:;\n+ return 0;\n+}\n2017-09-16 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.\n\n--- gcc/c-family/c-common.c\t(revision 252802)\n+++ gcc/c-family/c-common.c\t(revision 252803)\n@@ -10534,10 +10534,9 @@ sync_resolve_size (tree function, vec<tr\n }\n \n 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@@ -10692,10 +10691,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@@ -10734,6 +10732,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 252803)\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 252803)\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+}\n2017-09-16 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* gcc.target/powerpc/pr82112.c: New test.\n\t* g++.dg/ext/altivec-18.C: New test.\n\n--- gcc/testsuite/gcc.target/powerpc/pr82112.c\t(nonexistent)\n+++ gcc/testsuite/gcc.target/powerpc/pr82112.c\t(revision 252804)\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 252804)\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+}", "diff": "--- gcc/cp/semantics.c\t(revision 249482)\n+++ gcc/cp/semantics.c\t(revision 249483)\n@@ -4297,7 +4297,7 @@ handle_omp_array_sections_1 (tree c, tre\n \treturn error_mark_node;\n if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)\n \t{\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t return NULL_TREE;\n \t if (DECL_P (t))\n \t error_at (OMP_CLAUSE_LOCATION (c),\n@@ -5392,7 +5392,7 @@ finish_omp_clauses (tree clauses)\n \t t = OMP_CLAUSE_DECL (c);\n \t if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)\n \t {\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t\tbreak;\n \t if (DECL_P (t))\n \t\terror (\"%qD is not a variable in clause %qs\", t,\n@@ -5417,7 +5417,7 @@ finish_omp_clauses (tree clauses)\n \t t = OMP_CLAUSE_DECL (c);\n \t if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)\n \t {\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t\tbreak;\n \t if (DECL_P (t))\n \t\terror (\"%qD is not a variable in clause %<firstprivate%>\", t);\n@@ -5439,7 +5439,7 @@ finish_omp_clauses (tree clauses)\n \t t = OMP_CLAUSE_DECL (c);\n \t if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)\n \t {\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t\tbreak;\n \t if (DECL_P (t))\n \t\terror (\"%qD is not a variable in clause %<lastprivate%>\", t);\n@@ -5683,7 +5683,7 @@ finish_omp_clauses (tree clauses)\n \t t = OMP_CLAUSE_DECL (c);\n \t if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)\n \t {\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t\tbreak;\n \t if (DECL_P (t))\n \t\terror (\"%qD is not a variable in %<aligned%> clause\", t);\n@@ -5753,7 +5753,7 @@ finish_omp_clauses (tree clauses)\n \t remove = true;\n \t else if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)\n \t {\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t\tbreak;\n \t if (DECL_P (t))\n \t\terror (\"%qD is not a variable in %<depend%> clause\", t);\n@@ -5795,7 +5795,7 @@ finish_omp_clauses (tree clauses)\n \t remove = true;\n \t else if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)\n \t {\n-\t if (processing_template_decl)\n+\t if (processing_template_decl && TREE_CODE (t) != OVERLOAD)\n \t\tbreak;\n \t if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP\n \t\t && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER)\n--- gcc/testsuite/g++.dg/gomp/pr81154.C\t(nonexistent)\n+++ gcc/testsuite/g++.dg/gomp/pr81154.C\t(revision 249483)\n@@ -0,0 +1,51 @@\n+// PR c++/81154\n+// { dg-do compile }\n+\n+template <typename T>\n+struct C\n+{\n+ int foo (T n) const\n+ {\n+#pragma omp parallel shared (foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+#pragma omp parallel private (foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+#pragma omp parallel firstprivate (foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+#pragma omp parallel for lastprivate (foo)\t// { dg-error \"is not a variable in clause\" }\n+ for (T i = 0; i < n; i++)\n+ ;\n+#pragma omp parallel reduction (+:foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+ return 0;\n+ }\n+ int foo (int x, int y) { return x; }\n+};\n+\n+struct D\n+{\n+ typedef int T;\n+ int foo (T n) const\n+ {\n+#pragma omp parallel shared (foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+#pragma omp parallel private (foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+#pragma omp parallel firstprivate (foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+#pragma omp parallel for lastprivate (foo)\t// { dg-error \"is not a variable in clause\" }\n+ for (T i = 0; i < n; i++)\n+ ;\n+#pragma omp parallel reduction (+:foo)\t// { dg-error \"is not a variable in clause\" }\n+ ;\n+ return 0;\n+ }\n+ int foo (int x, int y) { return x; }\n+};\n+\n+int\n+main ()\n+{\n+ C<int> ().foo (1);\n+ D ().foo (1);\n+}\n", "prefixes": [] }