Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811168/?format=api
{ "id": 811168, "url": "http://patchwork.ozlabs.org/api/patches/811168/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20170907204422.GW2323@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": "<20170907204422.GW2323@tucnak>", "list_archive_url": null, "date": "2017-09-07T20:44:22", "name": "Backports to 7.x", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0f658f2338bf8f5b9c6fbe847bbaf935065e6c64", "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/20170907204422.GW2323@tucnak/mbox/", "series": [ { "id": 2060, "url": "http://patchwork.ozlabs.org/api/series/2060/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=2060", "date": "2017-09-07T20:44:22", "name": "Backports to 7.x", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2060/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811168/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811168/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-461694-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-461694-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=\"yCXQUA0U\"; 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 3xpCB844P4z9sBW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 8 Sep 2017 06:44:47 +1000 (AEST)", "(qmail 52486 invoked by alias); 7 Sep 2017 20:44:35 -0000", "(qmail 51465 invoked by uid 89); 7 Sep 2017 20:44:35 -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 20:44:28 +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 3BD2C37E88\tfor\n\t<gcc-patches@gcc.gnu.org>; Thu, 7 Sep 2017 20:44:27 +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 A362760241\tfor <gcc-patches@gcc.gnu.org>;\n\tThu, 7 Sep 2017 20:44:26 +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 v87KiNiR027971\tfor\n\t<gcc-patches@gcc.gnu.org>; Thu, 7 Sep 2017 22:44:24 +0200", "(from jakub@localhost)\tby tucnak.zalov.cz (8.15.2/8.15.2/Submit)\n\tid v87KiMqd027970\tfor gcc-patches@gcc.gnu.org;\n\tThu, 7 Sep 2017 22:44:22 +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=Avd39E5vYBTFjUPZB5iE5CkHl281kBXKDspNg3EfSgY\n\t/KZyCdpJkYQPTO41ARS5lVbbUmSM140LtB7f/UOJ9LvxDyheYEF+dWl9Bo9J9oao\n\ttXetZ18wUmuTks8esYtjKSyK1QA8iXQrNqjUoenTCJwt95B5slGb3K2u37x2JNaI\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=1q5KNC8AHXuv1lvmoZOmHB+43I4=; b=yCXQUA0UH0M5bqMbt\n\td6DJszAO422gJjdsPgfVdKNsQQXqQcOJzFgbzwzrktZjGqq4hDh2/DrBa/cJxXIj\n\t8Oc2T64gkFWjeOzl7wm4d5jQOw9M+DqpZyDIm1EnqpZklhSt9mjMVw4yGkzjtA2o\n\ti9XJx6FEP4XeiVqJ0rHj2enHzM=", "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 3BD2C37E88", "Date": "Thu, 7 Sep 2017 22:44:22 +0200", "From": "Jakub Jelinek <jakub@redhat.com>", "To": "gcc-patches@gcc.gnu.org", "Subject": "Backports to 7.x", "Message-ID": "<20170907204422.GW2323@tucnak>", "Reply-To": "Jakub Jelinek <jakub@redhat.com>", "MIME-Version": "1.0", "Content-Type": "multipart/mixed; boundary=\"/WwmFnJnmDyWGHa4\"", "Content-Disposition": "inline", "User-Agent": "Mutt/1.7.1 (2016-10-04)", "X-IsSubscribed": "yes" }, "content": "Hi!\n\nI've bootstrapped/regtested and committed to gcc-7-branch backports\nof 10 trunk commits.\n\n\tJakub\n2017-09-07 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.\n2017-09-07 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 250846)\n+++ gcc/omp-low.c\t(revision 250847)\n@@ -9083,7 +9083,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@@ -9343,7 +9343,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 250847)\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-07 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-08-03 Jakub Jelinek <jakub@redhat.com>\n\n\tPR driver/81650\n\t* calls.c (alloc_max_size): Use HOST_WIDE_INT_UC (10??)\n\tinstead of 10??LU, perform unit multiplication in wide_int,\n\tdon't change alloc_object_size_limit if the limit is larger\n\tthan SSIZE_MAX.\n\n\t* gcc.dg/pr81650.c: New test.\n\n--- gcc/calls.c\t(revision 250849)\n+++ gcc/calls.c\t(revision 250850)\n@@ -1222,32 +1222,38 @@ alloc_max_size (void)\n \t\t else if (!strcasecmp (end, \"KiB\") || strcmp (end, \"KB\"))\n \t\t unit = 1024;\n \t\t else if (!strcmp (end, \"MB\"))\n-\t\t unit = 1000LU * 1000;\n+\t\t unit = HOST_WIDE_INT_UC (1000) * 1000;\n \t\t else if (!strcasecmp (end, \"MiB\"))\n-\t\t unit = 1024LU * 1024;\n+\t\t unit = HOST_WIDE_INT_UC (1024) * 1024;\n \t\t else if (!strcasecmp (end, \"GB\"))\n-\t\t unit = 1000LU * 1000 * 1000;\n+\t\t unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000;\n \t\t else if (!strcasecmp (end, \"GiB\"))\n-\t\t unit = 1024LU * 1024 * 1024;\n+\t\t unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024;\n \t\t else if (!strcasecmp (end, \"TB\"))\n-\t\t unit = 1000LU * 1000 * 1000 * 1000;\n+\t\t unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000;\n \t\t else if (!strcasecmp (end, \"TiB\"))\n-\t\t unit = 1024LU * 1024 * 1024 * 1024;\n+\t\t unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024;\n \t\t else if (!strcasecmp (end, \"PB\"))\n-\t\t unit = 1000LU * 1000 * 1000 * 1000 * 1000;\n+\t\t unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000;\n \t\t else if (!strcasecmp (end, \"PiB\"))\n-\t\t unit = 1024LU * 1024 * 1024 * 1024 * 1024;\n+\t\t unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024;\n \t\t else if (!strcasecmp (end, \"EB\"))\n-\t\t unit = 1000LU * 1000 * 1000 * 1000 * 1000 * 1000;\n+\t\t unit = HOST_WIDE_INT_UC (1000) * 1000 * 1000 * 1000 * 1000\n+\t\t\t * 1000;\n \t\t else if (!strcasecmp (end, \"EiB\"))\n-\t\t unit = 1024LU * 1024 * 1024 * 1024 * 1024 * 1024;\n+\t\t unit = HOST_WIDE_INT_UC (1024) * 1024 * 1024 * 1024 * 1024\n+\t\t\t * 1024;\n \t\t else\n \t\t unit = 0;\n \t\t}\n \n \t if (unit)\n-\t\talloc_object_size_limit\n-\t\t = build_int_cst (ssizetype, limit * unit);\n+\t\t{\n+\t\t wide_int w = wi::uhwi (limit, HOST_BITS_PER_WIDE_INT + 64);\n+\t\t w *= unit;\n+\t\t if (wi::ltu_p (w, alloc_object_size_limit))\n+\t\t alloc_object_size_limit = wide_int_to_tree (ssizetype, w);\n+\t\t}\n \t }\n \t}\n }\n--- gcc/testsuite/gcc.dg/pr81650.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/pr81650.c\t(revision 250850)\n@@ -0,0 +1,9 @@\n+/* PR driver/81650 */\n+/* { dg-do compile } */\n+/* { dg-options \"-Walloc-size-larger-than=9223372036854775807\" } */\n+\n+void *\n+foo (void)\n+{\n+ return __builtin_malloc (5);\n+}\n2017-09-07 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 250856)\n+++ gcc/bb-reorder.c\t(revision 250857)\n@@ -2904,7 +2904,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@@ -2970,7 +2971,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 250857)\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-07 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-08-07 Jakub Jelinek <jakub@redhat.com>\n\n\t* include/system/sys/ptrace.h: New file.\n\n--- libsanitizer/include/system/sys/ptrace.h\t(nonexistent)\n+++ libsanitizer/include/system/sys/ptrace.h\t(revision 250910)\n@@ -0,0 +1,7 @@\n+#include_next <sys/ptrace.h>\n+#ifndef PTRACE_GETREGSET\n+/* glibc before\n+ https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=cbff0d9689c4d68578b6a4f0a17807232506ea27\n+ doesn't define PTRACE_GETREGSET. */\n+#define PTRACE_GETREGSET 0x4204\n+#endif\n2017-09-07 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 251018)\n+++ gcc/omp-low.c\t(revision 251019)\n@@ -798,6 +798,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 251018)\n+++ gcc/tree-cfg.c\t(revision 251019)\n@@ -6718,7 +6718,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@@ -6836,6 +6844,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 251019)\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 251019)\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-07 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-01 Jakub Jelinek <jakub@redhat.com>\n\n\tPR sanitizer/81923\n\t* asan.c (create_odr_indicator): Strip name encoding from assembler\n\tname before appending it after __odr_asan_.\n\n\t* gcc.dg/asan/pr81923.c: New test.\n\n--- gcc/asan.c\t(revision 251594)\n+++ gcc/asan.c\t(revision 251595)\n@@ -2527,9 +2527,12 @@ create_odr_indicator (tree decl, tree ty\n /* DECL_NAME theoretically might be NULL. Bail out with 0 in this case. */\n if (decl_name == NULL_TREE)\n return build_int_cst (uptr, 0);\n- size_t len = strlen (IDENTIFIER_POINTER (decl_name)) + sizeof (\"__odr_asan_\");\n+ const char *dname = IDENTIFIER_POINTER (decl_name);\n+ if (HAS_DECL_ASSEMBLER_NAME_P (decl))\n+ dname = targetm.strip_name_encoding (dname);\n+ size_t len = strlen (dname) + sizeof (\"__odr_asan_\");\n name = XALLOCAVEC (char, len);\n- snprintf (name, len, \"__odr_asan_%s\", IDENTIFIER_POINTER (decl_name));\n+ snprintf (name, len, \"__odr_asan_%s\", dname);\n #ifndef NO_DOT_IN_LABEL\n name[sizeof (\"__odr_asan\") - 1] = '.';\n #elif !defined(NO_DOLLAR_IN_LABEL)\n--- gcc/testsuite/gcc.dg/asan/pr81923.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/asan/pr81923.c\t(revision 251595)\n@@ -0,0 +1,10 @@\n+/* PR sanitizer/81923 */\n+/* { dg-do link } */\n+\n+int foobar __asm (__USER_LABEL_PREFIX__ \"barbaz\") = 34;\n+\n+int\n+main ()\n+{\n+ return 0;\n+}\n2017-09-07 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-04 Jakub Jelinek <jakub@redhat.com>\n\n\t* lra-remat.c (reg_overlap_for_remat_p): Fix a pasto.\n\n--- gcc/lra-remat.c\t(revision 251638)\n+++ gcc/lra-remat.c\t(revision 251639)\n@@ -684,7 +684,7 @@ reg_overlap_for_remat_p (lra_insn_reg *r\n \n \tif (regno2 >= FIRST_PSEUDO_REGISTER && reg_renumber[regno2] >= 0)\n \t regno2 = reg_renumber[regno2];\n-\tif (regno >= FIRST_PSEUDO_REGISTER)\n+\tif (regno2 >= FIRST_PSEUDO_REGISTER)\n \t nregs2 = 1;\n \telse\n \t nregs2 = hard_regno_nregs[regno2][reg->biggest_mode];\n2017-09-07 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-05 Jakub Jelinek <jakub@redhat.com>\n\n\tPR middle-end/81768\n\t* omp-expand.c (expand_omp_simd): Force second operands of COND_EXPR\n\tinto gimple val before gimplification fo the COND_EXPR.\n\n\t* gcc.dg/gomp/pr81768-1.c: New test.\n\n--- gcc/omp-expand.c\t(revision 251740)\n+++ gcc/omp-expand.c\t(revision 251741)\n@@ -4730,24 +4730,28 @@ expand_omp_simd (struct omp_region *regi\n \t tree itype2 = TREE_TYPE (fd->loops[i - 1].v);\n \t if (POINTER_TYPE_P (itype2))\n \t\titype2 = signed_type_for (itype2);\n+\t t = fold_convert (itype2, fd->loops[i - 1].step);\n+\t t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true,\n+\t\t\t\t\t GSI_SAME_STMT);\n \t t = build3 (COND_EXPR, itype2,\n \t\t\t build2 (fd->loops[i].cond_code, boolean_type_node,\n \t\t\t\t fd->loops[i].v,\n \t\t\t\t fold_convert (itype, fd->loops[i].n2)),\n-\t\t\t build_int_cst (itype2, 0),\n-\t\t\t fold_convert (itype2, fd->loops[i - 1].step));\n+\t\t\t build_int_cst (itype2, 0), t);\n \t if (POINTER_TYPE_P (TREE_TYPE (fd->loops[i - 1].v)))\n \t\tt = fold_build_pointer_plus (fd->loops[i - 1].v, t);\n \t else\n \t\tt = fold_build2 (PLUS_EXPR, itype2, fd->loops[i - 1].v, t);\n \t expand_omp_build_assign (&gsi, fd->loops[i - 1].v, t);\n \n+\t t = fold_convert (itype, fd->loops[i].n1);\n+\t t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true,\n+\t\t\t\t\t GSI_SAME_STMT);\n \t t = build3 (COND_EXPR, itype,\n \t\t\t build2 (fd->loops[i].cond_code, boolean_type_node,\n \t\t\t\t fd->loops[i].v,\n \t\t\t\t fold_convert (itype, fd->loops[i].n2)),\n-\t\t\t fd->loops[i].v,\n-\t\t\t fold_convert (itype, fd->loops[i].n1));\n+\t\t\t fd->loops[i].v, t);\n \t expand_omp_build_assign (&gsi, fd->loops[i].v, t);\n \t }\n \t}\n--- gcc/testsuite/gcc.dg/gomp/pr81768-1.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/gomp/pr81768-1.c\t(revision 251741)\n@@ -0,0 +1,15 @@\n+/* PR middle-end/81768 */\n+/* { dg-do compile } */\n+\n+float b[10][15][10];\n+\n+void\n+foo (void)\n+{\n+ float *i;\n+#pragma omp target parallel for simd schedule(static, 32) collapse(3)\n+ for (i = &b[0][0][0]; i < &b[0][0][10]; i++)\n+ for (float *j = &b[0][15][0]; j > &b[0][0][0]; j -= 10)\n+ for (float *k = &b[0][0][10]; k > &b[0][0][0]; --k)\n+\tb[i - &b[0][0][0]][(j - &b[0][0][0]) / 10 - 1][(k - &b[0][0][0]) - 1] -= 3.5;\n+}\n2017-09-07 Jakub Jelinek <jakub@redhat.com>\n\n\tBackported from mainline\n\t2017-09-05 Jakub Jelinek <jakub@redhat.com>\n\n\tPR middle-end/81768\n\t* omp-low.c (lower_omp_for): Recompute tree invariant if\n\tgimple_omp_for_initial/final is ADDR_EXPR.\n\n\t* gcc.dg/gomp/pr81768-2.c: New test.\n\n--- gcc/omp-low.c\t(revision 251741)\n+++ gcc/omp-low.c\t(revision 251742)\n@@ -6923,10 +6923,14 @@ lower_omp_for (gimple_stmt_iterator *gsi\n rhs_p = gimple_omp_for_initial_ptr (stmt, i);\n if (!is_gimple_min_invariant (*rhs_p))\n \t*rhs_p = get_formal_tmp_var (*rhs_p, &body);\n+ else if (TREE_CODE (*rhs_p) == ADDR_EXPR)\n+\trecompute_tree_invariant_for_addr_expr (*rhs_p);\n \n rhs_p = gimple_omp_for_final_ptr (stmt, i);\n if (!is_gimple_min_invariant (*rhs_p))\n \t*rhs_p = get_formal_tmp_var (*rhs_p, &body);\n+ else if (TREE_CODE (*rhs_p) == ADDR_EXPR)\n+\trecompute_tree_invariant_for_addr_expr (*rhs_p);\n \n rhs_p = &TREE_OPERAND (gimple_omp_for_incr (stmt, i), 1);\n if (!is_gimple_min_invariant (*rhs_p))\n--- gcc/testsuite/gcc.dg/gomp/pr81768-2.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/gomp/pr81768-2.c\t(revision 251742)\n@@ -0,0 +1,15 @@\n+/* PR middle-end/81768 */\n+/* { dg-do compile } */\n+\n+float b[10][15][10];\n+\n+void\n+foo (void)\n+{\n+ float *i;\n+#pragma omp target parallel for schedule(static, 32) collapse(3)\n+ for (i = &b[0][0][0]; i < &b[0][0][10]; i++)\n+ for (float *j = &b[0][15][0]; j > &b[0][0][0]; j -= 10)\n+ for (float *k = &b[0][0][10]; k > &b[0][0][0]; --k)\n+ b[i - &b[0][0][0]][(j - &b[0][0][0]) / 10 - 1][(k - &b[0][0][0]) - 1] -= 3.5;\n+}", "diff": "--- gcc/c-family/c-omp.c\t(revision 250634)\n+++ gcc/c-family/c-omp.c\t(revision 250635)\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 250635)\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 250635)\n@@ -0,0 +1,5 @@\n+// PR c/45784\n+// { dg-do run }\n+\n+#include \"../libgomp.c/pr45784.c\"\n+\n", "prefixes": [] }