get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 809614,
    "url": "http://patchwork.ozlabs.org/api/patches/809614/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/87tw0iheqh.fsf@linaro.org/",
    "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": "<87tw0iheqh.fsf@linaro.org>",
    "list_archive_url": null,
    "date": "2017-09-04T11:42:30",
    "name": "[8/9] Make mode_for_size_tree return an opt_mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7db20ce4548e9c3e6f983bb895e1db2bc4a01dbd",
    "submitter": {
        "id": 5450,
        "url": "http://patchwork.ozlabs.org/api/people/5450/?format=api",
        "name": "Richard Sandiford",
        "email": "richard.sandiford@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/87tw0iheqh.fsf@linaro.org/mbox/",
    "series": [
        {
            "id": 1357,
            "url": "http://patchwork.ozlabs.org/api/series/1357/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=1357",
            "date": "2017-09-04T11:24:26",
            "name": "Make more use of opt_mode",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1357/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/809614/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809614/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-461411-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-461411-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=\"wfneVZ79\"; 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 3xm7JB47kYz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 21:42:48 +1000 (AEST)",
            "(qmail 29208 invoked by alias); 4 Sep 2017 11:42:41 -0000",
            "(qmail 28502 invoked by uid 89); 4 Sep 2017 11:42:40 -0000",
            "from mail-wr0-f176.google.com (HELO mail-wr0-f176.google.com)\n\t(209.85.128.176) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tMon, 04 Sep 2017 11:42:35 +0000",
            "by mail-wr0-f176.google.com with SMTP id a43so862411wrc.0 for\n\t<gcc-patches@gcc.gnu.org>; Mon, 04 Sep 2017 04:42:34 -0700 (PDT)",
            "from localhost (94.197.120.41.threembb.co.uk. [94.197.120.41]) by\n\tsmtp.gmail.com with ESMTPSA id\n\tl126sm420995wmd.1.2017.09.04.04.42.31 for\n\t<gcc-patches@gcc.gnu.org> (version=TLS1_2\n\tcipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tMon, 04 Sep 2017 04:42:32 -0700 (PDT)"
        ],
        "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:subject:references:date:in-reply-to:message-id:mime-version\n\t:content-type; q=dns; s=default; b=cwQ0nErEDxg2aahmNpy2YLgEJ1H4D\n\tjw+xf3rFg148g+bWgcmhpFajhBTJWuIkfY/5dWEGbCsPevgAiys3LLpo+VDLJm9D\n\tKbxWhz9d0iucMmIgreZkJz1EHO4ux9bpOoBLftbM1b44MwGYI/6WVngJVYfu6QiZ\n\tw/iS7q/Jm5wWSU=",
        "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:subject:references:date:in-reply-to:message-id:mime-version\n\t:content-type; s=default; bh=v2O79Gx3MLHDQQQSK4/L3rJduLE=; b=wfn\n\teVZ79VQMgUlfYVr0j1mxs6zqBfe7YldM9Bqusz/GZFpegtJD9V/wbRRZPIaTQPAH\n\tGgZaPnHtXj5DwY8Hg31nY4vPFp+GAfqW7WUSOrn+CNUXZd7sRbIDM4jubC4KlUiS\n\tPrB5a2yCpiR8uXUP8shQZSPL+ES8ratNjkCIXVQA=",
        "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.0 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=",
        "X-HELO": "mail-wr0-f176.google.com",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:from:to:mail-followup-to:subject:references:date\n\t:in-reply-to:message-id:user-agent:mime-version;\n\tbh=Si19PDkXLQ1bfCwr+nWHdzPTeFDs8KjFRybi2JPc+7U=;\n\tb=rfMXXATIhgCT3DOMhIRilT/Tyd4tSKK6leoI0dKKGT4B0hlCqGJUrXn9jBYVU8K+Om\n\t3GU2qGaElU/pUhaKlcMEbztKza1WslXLZU9soNdczlkwAtAh41ijFzdTaa9p/jiDpkZ4\n\tOvpadwkGvPPibeU63DIwU5EtoN4ggP6TCOUt2YaaMEnviFRgU6oI0TsIWbyDnzgsXOqE\n\tQ2WcJk93vK5Alps9ADrup2/q1+c7BnpuO7satnupXA1Qf9vt6WiL0K7ckEUfZyratykP\n\tUT+2OMEAlUX+RJKqBU85/1mtgmsQ8VHeo0twTyWQ0JZc6b64bQCU4SdElS7PVgwDFtC7\n\tIccg==",
        "X-Gm-Message-State": "AHPjjUibbxFl6hQ4kFUDhlaW3LkEK1I2BDJgTVS7FAs/JDaRuUC0f80o\ts1ILcK+xQFO6MDgHaFUnPQ==",
        "X-Google-Smtp-Source": "ADKCNb77XYb5vgFtIswj0iSRuHjp8cuwCxeEf5OPPwSzv1cwlNq89zRhNUhYVIaPD9xlJtN9wUiK/g==",
        "X-Received": "by 10.223.188.68 with SMTP id a4mr141713wrh.300.1504525352852;\n\tMon, 04 Sep 2017 04:42:32 -0700 (PDT)",
        "From": "Richard Sandiford <richard.sandiford@linaro.org>",
        "To": "gcc-patches@gcc.gnu.org",
        "Mail-Followup-To": "gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org",
        "Subject": "[8/9] Make mode_for_size_tree return an opt_mode",
        "References": "<87tw0iiu51.fsf@linaro.org>",
        "Date": "Mon, 04 Sep 2017 12:42:30 +0100",
        "In-Reply-To": "<87tw0iiu51.fsf@linaro.org> (Richard Sandiford's message of\n\t\"Mon, 04 Sep 2017 12:24:26 +0100\")",
        "Message-ID": "<87tw0iheqh.fsf@linaro.org>",
        "User-Agent": "Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain"
    },
    "content": "...for consistency with mode_for_size\n\n2017-09-04  Richard Sandiford  <richard.sandiford@linaro.org>\n\ngcc/\n\t* stor-layout.h (mode_for_size_tree): Return an opt_mode.\n\t* stor-layout.c (mode_for_size_tree): Likewise.\n\t(mode_for_array): Update accordingly.\n\t(layout_decl): Likewise.\n\t(compute_record_mode): Likewise.  Only set the mode once.\n\ngcc/ada/\n\t* gcc-interface/utils.c (make_packable_type): Update call to\n\tmode_for_size_tree.",
    "diff": "Index: gcc/stor-layout.h\n===================================================================\n--- gcc/stor-layout.h\t2017-08-21 12:14:47.158835574 +0100\n+++ gcc/stor-layout.h\t2017-09-04 12:19:01.144339518 +0100\n@@ -99,7 +99,7 @@ extern tree make_unsigned_type (int);\n    If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.\n    The value is BLKmode if no other mode is found.  This is like\n    mode_for_size, but is passed a tree.  */\n-extern machine_mode mode_for_size_tree (const_tree, enum mode_class, int);\n+extern opt_machine_mode mode_for_size_tree (const_tree, enum mode_class, int);\n \n extern tree bitwise_type_for_mode (machine_mode);\n \nIndex: gcc/stor-layout.c\n===================================================================\n--- gcc/stor-layout.c\t2017-09-04 12:18:55.824344959 +0100\n+++ gcc/stor-layout.c\t2017-09-04 12:19:01.144339518 +0100\n@@ -321,19 +321,19 @@ mode_for_size (unsigned int size, enum m\n \n /* Similar, except passed a tree node.  */\n \n-machine_mode\n+opt_machine_mode\n mode_for_size_tree (const_tree size, enum mode_class mclass, int limit)\n {\n   unsigned HOST_WIDE_INT uhwi;\n   unsigned int ui;\n \n   if (!tree_fits_uhwi_p (size))\n-    return BLKmode;\n+    return opt_machine_mode ();\n   uhwi = tree_to_uhwi (size);\n   ui = uhwi;\n   if (uhwi != ui)\n-    return BLKmode;\n-  return mode_for_size (ui, mclass, limit).else_blk ();\n+    return opt_machine_mode ();\n+  return mode_for_size (ui, mclass, limit);\n }\n \n /* Return the narrowest mode of class MCLASS that contains at least\n@@ -563,7 +563,7 @@ mode_for_array (tree elem_type, tree siz\n \t\t\t\t\t     int_size / int_elem_size))\n \tlimit_p = false;\n     }\n-  return mode_for_size_tree (size, MODE_INT, limit_p);\n+  return mode_for_size_tree (size, MODE_INT, limit_p).else_blk ();\n }\n \f\n /* Subroutine of layout_decl: Force alignment required for the data type.\n@@ -683,17 +683,18 @@ layout_decl (tree decl, unsigned int kno\n \t      && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST\n \t      && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT)\n \t    {\n-\t      machine_mode xmode\n-\t\t= mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);\n-\t      unsigned int xalign = GET_MODE_ALIGNMENT (xmode);\n-\n-\t      if (xmode != BLKmode\n-\t\t  && !(xalign > BITS_PER_UNIT && DECL_PACKED (decl))\n-\t\t  && (known_align == 0 || known_align >= xalign))\n+\t      machine_mode xmode;\n+\t      if (mode_for_size_tree (DECL_SIZE (decl),\n+\t\t\t\t      MODE_INT, 1).exists (&xmode))\n \t\t{\n-\t\t  SET_DECL_ALIGN (decl, MAX (xalign, DECL_ALIGN (decl)));\n-\t\t  SET_DECL_MODE (decl, xmode);\n-\t\t  DECL_BIT_FIELD (decl) = 0;\n+\t\t  unsigned int xalign = GET_MODE_ALIGNMENT (xmode);\n+\t\t  if (!(xalign > BITS_PER_UNIT && DECL_PACKED (decl))\n+\t\t      && (known_align == 0 || known_align >= xalign))\n+\t\t    {\n+\t\t      SET_DECL_ALIGN (decl, MAX (xalign, DECL_ALIGN (decl)));\n+\t\t      SET_DECL_MODE (decl, xmode);\n+\t\t      DECL_BIT_FIELD (decl) = 0;\n+\t\t    }\n \t\t}\n \t    }\n \n@@ -1756,22 +1757,24 @@ compute_record_mode (tree type)\n   if (TREE_CODE (type) == RECORD_TYPE && mode != VOIDmode\n       && tree_fits_uhwi_p (TYPE_SIZE (type))\n       && GET_MODE_BITSIZE (mode) == tree_to_uhwi (TYPE_SIZE (type)))\n-    SET_TYPE_MODE (type, mode);\n+    ;\n   else\n-    SET_TYPE_MODE (type, mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1));\n+    mode = mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1).else_blk ();\n \n   /* If structure's known alignment is less than what the scalar\n      mode would need, and it matters, then stick with BLKmode.  */\n-  if (TYPE_MODE (type) != BLKmode\n+  if (mode != BLKmode\n       && STRICT_ALIGNMENT\n       && ! (TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT\n-\t    || TYPE_ALIGN (type) >= GET_MODE_ALIGNMENT (TYPE_MODE (type))))\n+\t    || TYPE_ALIGN (type) >= GET_MODE_ALIGNMENT (mode)))\n     {\n       /* If this is the only reason this type is BLKmode, then\n \t don't force containing types to be BLKmode.  */\n       TYPE_NO_FORCE_BLK (type) = 1;\n-      SET_TYPE_MODE (type, BLKmode);\n+      mode = BLKmode;\n     }\n+\n+  SET_TYPE_MODE (type, mode);\n }\n \n /* Compute TYPE_SIZE and TYPE_ALIGN for TYPE, once it has been laid\nIndex: gcc/ada/gcc-interface/utils.c\n===================================================================\n--- gcc/ada/gcc-interface/utils.c\t2017-08-30 12:10:52.658405667 +0100\n+++ gcc/ada/gcc-interface/utils.c\t2017-09-04 12:19:01.143335745 +0100\n@@ -1076,7 +1076,8 @@ make_packable_type (tree type, bool in_r\n      in case the record itself contains a BLKmode field.  */\n   if (in_record && TYPE_MODE (new_type) == BLKmode)\n     SET_TYPE_MODE (new_type,\n-\t\t   mode_for_size_tree (TYPE_SIZE (new_type), MODE_INT, 1));\n+\t\t   mode_for_size_tree (TYPE_SIZE (new_type),\n+\t\t\t\t       MODE_INT, 1).else_blk ());\n \n   /* If neither mode nor size nor alignment shrunk, return the old type.  */\n   if (TYPE_MODE (new_type) == BLKmode && new_size >= size && max_align == 0)\n",
    "prefixes": [
        "8/9"
    ]
}