get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806709,
    "url": "http://patchwork.ozlabs.org/api/patches/806709/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/82ea4bb9-15cb-b00d-c6af-e1de926a9cec@mentor.com/",
    "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": "<82ea4bb9-15cb-b00d-c6af-e1de926a9cec@mentor.com>",
    "list_archive_url": null,
    "date": "2017-08-28T18:26:27",
    "name": "Fix bug in simplify_ternary_operation",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3c2049f8ea6350af65875cc3c9841b730cd5ea0f",
    "submitter": {
        "id": 9225,
        "url": "http://patchwork.ozlabs.org/api/people/9225/?format=api",
        "name": "Tom de Vries",
        "email": "Tom_deVries@mentor.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/82ea4bb9-15cb-b00d-c6af-e1de926a9cec@mentor.com/mbox/",
    "series": [
        {
            "id": 234,
            "url": "http://patchwork.ozlabs.org/api/series/234/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=234",
            "date": "2017-08-28T18:26:27",
            "name": "Fix bug in simplify_ternary_operation",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/234/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806709/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806709/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-461037-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-461037-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=\"DD4YiRGq\"; 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 3xh0bk27b0z9sN7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 04:26:58 +1000 (AEST)",
            "(qmail 48603 invoked by alias); 28 Aug 2017 18:26:50 -0000",
            "(qmail 48587 invoked by uid 89); 28 Aug 2017 18:26:49 -0000",
            "from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131)\n\tby sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with\n\tESMTP; Mon, 28 Aug 2017 18:26:39 +0000",
            "from nat-ies.mentorg.com ([192.94.31.2]\n\thelo=SVR-IES-MBX-04.mgc.mentorg.com)\tby relay1.mentorg.com\n\twith esmtp id 1dmOk8-00019V-Ow from Tom_deVries@mentor.com ;\n\tMon, 28 Aug 2017 11:26:36 -0700",
            "from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com\n\t(139.181.222.4) with Microsoft SMTP Server (TLS) id\n\t15.0.1263.5; Mon, 28 Aug 2017 19:26:32 +0100"
        ],
        "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:to:cc:subject:message-id:date:mime-version:content-type; q=dns;\n\ts=default; b=ERtn1QenzqgGYF2IouB0z6SGEtQdnm+7TtBVhAtSiLJ/lKQRzv\n\td12/0QyR0GpOm6/8ScTJorCVQtk3ycnmVkTZzeO6i6GhFMAKV5X5zSo4ToR5yqdO\n\tKdLF1CXrTdLfJkpyJTM/A3CgaDGhTrU7iqzhL07bhZ228kLj4zKbold2o=",
        "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:to:cc:subject:message-id:date:mime-version:content-type; s=\n\tdefault; bh=4vBaxcB8WcikQFo5ACPhmoKDtJE=; b=DD4YiRGqPWAdRcc94SzD\n\tYSDI1wGJGcT/36HuJErM2/Fm2vm7sK26YVQQDrNUz0c7SuJ6wk7GAzfKyrfpZpQ8\n\tcM3s6t6IrB5k0sDcaeI3xZHQ2UpXtAAbkp7fbqL5bb+5lavWaLoct5VbUtlil+bm\n\tsL4XY7hi6H0LUBxzry774f8=",
        "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=-24.6 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_DNSWL_NONE,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=OP0",
        "X-HELO": "relay1.mentorg.com",
        "From": "Tom de Vries <Tom_deVries@mentor.com>",
        "To": "Jeff Law <law@redhat.com>",
        "CC": "GCC Patches <gcc-patches@gcc.gnu.org>",
        "Subject": "[PATCH] Fix bug in simplify_ternary_operation",
        "Message-ID": "<82ea4bb9-15cb-b00d-c6af-e1de926a9cec@mentor.com>",
        "Date": "Mon, 28 Aug 2017 20:26:27 +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=\"------------8D11220918040EAA84646947\"",
        "X-ClientProxiedBy": "svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tSVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4)"
    },
    "content": "Hi,\n\nI think I found a bug in r17465:\n...\n>        * cse.c (simplify_ternary_operation): Handle more IF_THEN_ELSE\n>        simplifications.\n> \n> diff --git a/gcc/cse.c b/gcc/cse.c\n> index e001597..3c27387 100644\n> --- a/gcc/cse.c\n> +++ b/gcc/cse.c\n> @@ -4713,6 +4713,17 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)\n\nNote: the parameters of simplify_ternary_operation have the following \nmeaning:\n...\n/* Simplify CODE, an operation with result mode MODE and three operands,\n    OP0, OP1, and OP2.  OP0_MODE was the mode of OP0 before it became\n    a constant.  Return 0 if no simplifications is possible.  */\n\nrtx\nsimplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)\n      enum rtx_code code;\n      enum machine_mode mode, op0_mode;\n      rtx op0, op1, op2;\n...\n\n>           && rtx_equal_p (XEXP (op0, 1), op1)\n>           && rtx_equal_p (XEXP (op0, 0), op2))\n>         return op2;\n> +      else if (! side_effects_p (op0))\n> +       {\n> +         rtx temp;\n> +         temp = simplify_relational_operation (GET_CODE (op0), op0_mode,\n> +                                               XEXP (op0, 0), XEXP (op0, 1));\n\nWe're handling code == IF_THEN_ELSE here, so op0 is the condition, op1 \nis the 'then expr' and op2 is the 'else expr'.\n\nThe parameters of simplify_relational_operation have the following meaning:\n...\n/* Like simplify_binary_operation except used for relational operators.\n    MODE is the mode of the operands, not that of the result.  If MODE\n    is VOIDmode, both operands must also be VOIDmode and we compare the\n    operands in \"infinite precision\".\n\n    If no simplification is possible, this function returns zero.\n    Otherwise, it returns either const_true_rtx or const0_rtx.  */\n\nrtx\nsimplify_relational_operation (code, mode, op0, op1)\n      enum rtx_code code;\n      enum machine_mode mode;\n      rtx op0, op1;\n...\n\nThe problem in the patch is that we use op0_mode argument for the mode \nparameter. The mode parameter of simplify_relational_operation needs to \nbe the mode of the operands of the condition, while op0_mode is the mode \nof the condition.\n\nPatch below fixes this on current trunk.\n\n[ I found this by running into an ICE in \ngcc.c-torture/compile/pr28776-2.c for gcn target. I haven't been able to \nreproduce this with an upstream branch yet. ]\n\nOK for trunk if bootstrap and reg-test for x86_64 succeeds?\n\nThanks,\n- Tom",
    "diff": "diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c\nindex 0133d43..fbf979b 100644\n--- a/gcc/simplify-rtx.c\n+++ b/gcc/simplify-rtx.c\n@@ -5567,8 +5567,6 @@ simplify_ternary_operation (enum rtx_code code, machine_mode mode,\n \t\t\t\t\t      XEXP (op0, 0), XEXP (op0, 1));\n \t    }\n \n-\t  if (cmp_mode == VOIDmode)\n-\t    cmp_mode = op0_mode;\n \t  temp = simplify_relational_operation (GET_CODE (op0), op0_mode,\n \t\t\t  \t\t\tcmp_mode, XEXP (op0, 0),\n \t\t\t\t\t\tXEXP (op0, 1));\n",
    "prefixes": []
}