get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/808563/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 808563,
    "url": "http://patchwork.ozlabs.org/api/patches/808563/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/1a8274d7-4967-a055-90eb-c4d6ba969640@suse.cz/",
    "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": "<1a8274d7-4967-a055-90eb-c4d6ba969640@suse.cz>",
    "list_archive_url": null,
    "date": "2017-09-01T07:47:17",
    "name": "Fix profile update in tree-ssa-isolate-paths.c (PR tree-optimization/82059).",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e106622df27746e3f205c57a5521a6b8e2d36c0e",
    "submitter": {
        "id": 62010,
        "url": "http://patchwork.ozlabs.org/api/people/62010/?format=api",
        "name": "Martin Liška",
        "email": "mliska@suse.cz"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/1a8274d7-4967-a055-90eb-c4d6ba969640@suse.cz/mbox/",
    "series": [
        {
            "id": 968,
            "url": "http://patchwork.ozlabs.org/api/series/968/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=968",
            "date": "2017-09-01T07:47:17",
            "name": "Fix profile update in tree-ssa-isolate-paths.c (PR tree-optimization/82059).",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/968/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808563/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808563/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-461252-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-461252-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=\"Kwu1UDim\"; dkim-atps=neutral",
            "sourceware.org; auth=none"
        ],
        "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 3xkBDX5KqCz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 17:47:52 +1000 (AEST)",
            "(qmail 30056 invoked by alias); 1 Sep 2017 07:47:41 -0000",
            "(qmail 20677 invoked by uid 89); 1 Sep 2017 07:47:25 -0000",
            "from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tFri, 01 Sep 2017 07:47:20 +0000",
            "from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id 7311DABB2;\n\tFri,  1 Sep 2017 07:47:18 +0000 (UTC)"
        ],
        "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:from\n\t:subject:to:cc:message-id:date:mime-version:content-type; q=dns;\n\ts=default; b=EYKxrntWuOPM4d7RVMnHYiQCWLO1SVRTqIvkXs9sYQeHXMSC2w\n\t1ZWIoNO5miRJvcVEcexEFaEmM5kKp1LGoe075wsiF6HvZErXhhDQDuF+oN12zh5S\n\tNjMUOrLtHQi7K/E2dcoq4JYqzs5AeyAMeUi2Kns82BzUsYQJiexxxujj0=",
        "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:from\n\t:subject:to:cc:message-id:date:mime-version:content-type; s=\n\tdefault; bh=9G2qKD2nNDLOfjJgT4N5FDS8+4E=; b=Kwu1UDim/akixY8z5jDr\n\tfg1T0vvkGIJIOdkF5Xoh/0hVvFNsva2+74NLpBFzrLWgsrhXJFv0ALMcCFZ6qWmF\n\tskACDkr1+Gt4oybVUMl9km7lEvKzl2kEK5A7IZ8p6CzxDHo7X9sj7XqYQbsQnMNf\n\tBgcOduSJYAAcwf6NrBSDz7U=",
        "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=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=exhibits,\n\tisolation",
        "X-HELO": "mx1.suse.de",
        "From": "=?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz>",
        "Subject": "[PATCH] Fix profile update in tree-ssa-isolate-paths.c (PR\n\ttree-optimization/82059).",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "Jan Hubicka <hubicka@ucw.cz>",
        "Message-ID": "<1a8274d7-4967-a055-90eb-c4d6ba969640@suse.cz>",
        "Date": "Fri, 1 Sep 2017 09:47:17 +0200",
        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/mixed;\n\tboundary=\"------------D81F9BAD2C6199C8112CCED0\"",
        "X-IsSubscribed": "yes"
    },
    "content": "Hello.\n\nIn order to have valid profile, we should add counts of an edge only when\nit's really redirected and hasn't been redirected in previous invocation of the function.\n\nPatch can bootstrap on ppc64le-redhat-linux and survives regression tests.\n\nReady to be installed?\nMartin\n\ngcc/ChangeLog:\n\n2017-08-31  Martin Liska  <mliska@suse.cz>\n\n\tPR tree-optimization/82059\n\t* gimple-ssa-isolate-paths.c (isolate_path): Add profile and\n\tfrequency only when an edge is redirected.\n\ngcc/testsuite/ChangeLog:\n\n2017-08-31  Martin Liska  <mliska@suse.cz>\n\n\tPR tree-optimization/82059\n\t* gcc.dg/tree-ssa/pr82059.c: New test.\n---\n gcc/gimple-ssa-isolate-paths.c          |  9 ++++++---\n gcc/testsuite/gcc.dg/tree-ssa/pr82059.c | 22 ++++++++++++++++++++++\n 2 files changed, 28 insertions(+), 3 deletions(-)\n create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr82059.c",
    "diff": "diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c\nindex fbc41057463..807e0032410 100644\n--- a/gcc/gimple-ssa-isolate-paths.c\n+++ b/gcc/gimple-ssa-isolate-paths.c\n@@ -160,14 +160,17 @@ isolate_path (basic_block bb, basic_block duplicate,\n \tfor (ei = ei_start (duplicate->succs); (e2 = ei_safe_edge (ei)); )\n \t  remove_edge (e2);\n     }\n-  bb->frequency += EDGE_FREQUENCY (e);\n-  bb->count += e->count;\n \n   /* Complete the isolation step by redirecting E to reach DUPLICATE.  */\n   e2 = redirect_edge_and_branch (e, duplicate);\n   if (e2)\n-    flush_pending_stmts (e2);\n+    {\n+      flush_pending_stmts (e2);\n \n+      /* Update profile only when redirection is really processed.  */\n+      bb->frequency += EDGE_FREQUENCY (e);\n+      bb->count += e->count;\n+    }\n \n   /* There may be more than one statement in DUPLICATE which exhibits\n      undefined behavior.  Ultimately we want the first such statement in\ndiff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr82059.c b/gcc/testsuite/gcc.dg/tree-ssa/pr82059.c\nnew file mode 100644\nindex 00000000000..0285b03cc04\n--- /dev/null\n+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82059.c\n@@ -0,0 +1,22 @@\n+/* PR tree-optimization/82059 */\n+/* { dg-do compile } */\n+/* { dg-options \"-O2 -fdump-tree-isolate-paths\" } */\n+\n+struct a\n+{\n+  char b;\n+  struct a *c;\n+} d (), f;\n+void *e;\n+long g;\n+void\n+h ()\n+{\n+  struct a *i = 0;\n+  if (g)\n+    i = e;\n+  if (!i)\n+    d ();\n+  i->c = &f;\n+  i->b = *(char *) h;\n+}\n\n",
    "prefixes": []
}