get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2226760,
    "url": "http://patchwork.ozlabs.org/api/patches/2226760/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhup4p5wp2.gcc.gcc-TEST.pinskia.84.1.1@forge-stage.sourceware.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": "<bmm.hhup4p5wp2.gcc.gcc-TEST.pinskia.84.1.1@forge-stage.sourceware.org>",
    "list_archive_url": null,
    "date": "2026-04-22T18:49:09",
    "name": "[v1,01/10] fab/forwprop: Move memcmp->memcmp_eq to forwprop",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "73e89c7274a40876bbc03b4809c0a0cb5aabdb1e",
    "submitter": {
        "id": 93219,
        "url": "http://patchwork.ozlabs.org/api/people/93219/?format=api",
        "name": "Andrew Pinski via Sourceware Forge",
        "email": "forge-bot+pinskia@forge-stage.sourceware.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhup4p5wp2.gcc.gcc-TEST.pinskia.84.1.1@forge-stage.sourceware.org/mbox/",
    "series": [
        {
            "id": 501092,
            "url": "http://patchwork.ozlabs.org/api/series/501092/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501092",
            "date": "2026-04-22T18:49:11",
            "name": "remove_fab",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501092/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2226760/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2226760/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org",
            "sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g18Mt5RbCz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 05:26:02 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B1B22402A55D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 19:26:00 +0000 (GMT)",
            "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id A44B7407FF5B\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:50:41 +0000 (GMT)",
            "from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 7ED7843590\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:50:41 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org B1B22402A55D",
            "OpenDKIM Filter v2.11.0 sourceware.org A44B7407FF5B"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org A44B7407FF5B",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org A44B7407FF5B",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776883841; cv=none;\n b=Iywdg0vJ+tQj6XpiWAXDxFXmIcBSXu+P0B/1wSAXf6m083HYux1jsRqOK7xmDRZNh3dfjnw5VKwfzaWtbJAFzxoOAVAwwbyT0Kq2FpWNjEmrtUuhlEOJIfPFZ/YcAc5KesgMNYEHYUmIoyAGpvE1WHrPZrlG5RRxL9l2S9jN0QE=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776883841; c=relaxed/simple;\n bh=Jr7/JNg6C2YvPndafb7ptWIOfqiPUr7cTAh4fsVmmB8=;\n h=From:Date:Subject:To:Message-ID;\n b=Fv/9pTUN5YyDRKCdl1ixt4i3wDReJmiWCMwbU1IZ1s0amHsM8JBQh/zkX1zmA+RsQ1Q0XKSlRG7hHeTCSZ6XKvb7P+CjKPJBNjFbmt2A5ON8w87C6IT18sTFKm7BGfnqw1sGyYxCsVMC2s+KLRYuZuduq5vl5m+6xN3iiggIqHw=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "From": "Andrew Pinski via Sourceware Forge\n <forge-bot+pinskia@forge-stage.sourceware.org>",
        "Date": "Wed, 22 Apr 2026 18:49:09 +0000",
        "Subject": "[PATCH v1 01/10] fab/forwprop: Move memcmp->memcmp_eq to forwprop",
        "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>",
        "Message-ID": "\n <bmm.hhup4p5wp2.gcc.gcc-TEST.pinskia.84.1.1@forge-stage.sourceware.org>",
        "X-Mailer": "batrachomyomachia",
        "X-Pull-Request-Organization": "gcc",
        "X-Pull-Request-Repository": "gcc-TEST",
        "X-Pull-Request": "https://forge.sourceware.org/gcc/gcc-TEST/pulls/84",
        "References": "\n <bmm.hhup4p5wp2.gcc.gcc-TEST.pinskia.84.1.0@forge-stage.sourceware.org>",
        "In-Reply-To": "\n <bmm.hhup4p5wp2.gcc.gcc-TEST.pinskia.84.1.0@forge-stage.sourceware.org>",
        "X-Patch-URL": "\n https://forge.sourceware.org/pinskia/gcc-TEST/commit/934f80e6fb2acb7594c843278a5218c4bf583284",
        "X-BeenThere": "gcc-patches@gcc.gnu.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>",
        "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>",
        "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>",
        "Reply-To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>,\n pinskia@gcc.gnu.org",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "From: Andrew Pinski <andrew.pinski@oss.qualcomm.com>\n\nThis moves from the memcmp->memcmp_eq to forwprop by\nchecking PROP_last_full_fold.\n\nNote this means at -Og, we no longer optimize some\nmemcmp. That will be fixed when I exchange fab/copyprop\nfor a (late) forwprop.\n\nBootstrapped and tested on x86_64-linux-gnu.\n\ngcc/ChangeLog:\n\n\t* tree-ssa-ccp.cc (optimize_memcmp_eq): Remove.\n\t(pass_fold_builtins::execute): Remove handling of memcmp.\n\t* tree-ssa-forwprop.cc (simplify_builtin_memcmp): Add folding\n\tof memcmp to memcmp_eq for PROP_last_full_fold.\n\nSigned-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>\n---\n gcc/tree-ssa-ccp.cc      | 34 ----------------------------------\n gcc/tree-ssa-forwprop.cc | 10 +++++++++-\n 2 files changed, 9 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc\nindex 4165e596033f..1fbc3de2bfe7 100644\n--- a/gcc/tree-ssa-ccp.cc\n+++ b/gcc/tree-ssa-ccp.cc\n@@ -4205,36 +4205,6 @@ public:\n \n }; // class pass_fold_builtins\n \n-/* Optimize memcmp STMT into memcmp_eq if it is only used with\n-   `== 0` or `!= 0`. */\n-\n-static void\n-optimize_memcmp_eq (gcall *stmt)\n-{\n-  /* Make sure memcmp arguments are the correct type.  */\n-  if (gimple_call_num_args (stmt) != 3)\n-    return;\n-  tree arg1 = gimple_call_arg (stmt, 0);\n-  tree arg2 = gimple_call_arg (stmt, 1);\n-  tree len = gimple_call_arg (stmt, 2);\n-\n-  if (!POINTER_TYPE_P (TREE_TYPE (arg1)))\n-    return;\n-  if (!POINTER_TYPE_P (TREE_TYPE (arg2)))\n-    return;\n-  if (!INTEGRAL_TYPE_P (TREE_TYPE (len)))\n-    return;\n-  /* The return value of the memcmp has to be used\n-     equality comparison to zero. */\n-  tree res = gimple_call_lhs (stmt);\n-\n-  if (!res || !use_in_zero_equality (res))\n-    return;\n-\n-  gimple_call_set_fndecl (stmt, builtin_decl_explicit (BUILT_IN_MEMCMP_EQ));\n-  update_stmt (stmt);\n-}\n-\n unsigned int\n pass_fold_builtins::execute (function *fun)\n {\n@@ -4291,10 +4261,6 @@ pass_fold_builtins::execute (function *fun)\n \t\t  gsi_next (&i);\n \t\t  continue;\n \n-\t\tcase BUILT_IN_MEMCMP:\n-\t\t  optimize_memcmp_eq (as_a<gcall*>(stmt));\n-\t\t  break;\n-\n \t\tcase BUILT_IN_UNREACHABLE:\n \t\t  if (optimize_unreachable (i))\n \t\t    cfg_changed = true;\ndiff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc\nindex 4c438a0f86c9..917f3d90f6c2 100644\n--- a/gcc/tree-ssa-forwprop.cc\n+++ b/gcc/tree-ssa-forwprop.cc\n@@ -1842,7 +1842,15 @@ simplify_builtin_memcmp (gimple_stmt_iterator *gsi_p, gcall *stmt)\n \t  return true;\n \t}\n     }\n-  return false;\n+\n+  /* Replace memcmp with memcmp_eq if the above fails. */\n+  if (DECL_FUNCTION_CODE (gimple_call_fndecl (stmt)) == BUILT_IN_MEMCMP_EQ)\n+    return false;\n+  if (!(cfun->curr_properties & (PROP_last_full_fold)))\n+    return false;\n+  gimple_call_set_fndecl (stmt, builtin_decl_explicit (BUILT_IN_MEMCMP_EQ));\n+  update_stmt (stmt);\n+  return true;\n }\n \n /* Optimizes builtin memchrs for small constant sizes with a const string.\n",
    "prefixes": [
        "v1",
        "01/10"
    ]
}