get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2232539,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2232539/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/9d58dc6e-c551-4842-ab46-6073f598b1ba@redhat.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.1/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
    },
    "msgid": "<9d58dc6e-c551-4842-ab46-6073f598b1ba@redhat.com>",
    "date": "2026-05-04T17:22:56",
    "name": "Handle integer constants up front.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "574c6734bab3e9c33e78f98305fb696704ea98b4",
    "submitter": {
        "id": 7458,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/7458/?format=api",
        "name": "Andrew MacLeod",
        "email": "amacleod@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/9d58dc6e-c551-4842-ab46-6073f598b1ba@redhat.com/mbox/",
    "series": [
        {
            "id": 502703,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502703/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=502703",
            "date": "2026-05-04T17:22:56",
            "name": "Handle integer constants up front.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502703/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2232539/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2232539/checks/",
    "tags": {},
    "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\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=hVcoFXNa;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=hVcoFXNa",
            "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com",
            "sourceware.org; spf=pass smtp.mailfrom=redhat.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4g8T5S3nKsz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 03:23:56 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B24224BAD15B\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  4 May 2026 17:23:54 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 264254BAE7CA\n for <gcc-patches@gcc.gnu.org>; Mon,  4 May 2026 17:23:02 +0000 (GMT)",
            "from mail-qt1-f198.google.com (mail-qt1-f198.google.com\n [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-359-hanoiJObO3infRr59eYzFg-1; Mon, 04 May 2026 13:23:00 -0400",
            "by mail-qt1-f198.google.com with SMTP id\n d75a77b69052e-50d8e8c47a3so122041511cf.0\n for <gcc-patches@gcc.gnu.org>; Mon, 04 May 2026 10:23:00 -0700 (PDT)",
            "from [192.168.49.94] ([68.179.25.249])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b538a293dbsm142555266d6.2.2026.05.04.10.22.57\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Mon, 04 May 2026 10:22:57 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org B24224BAD15B",
            "OpenDKIM Filter v2.11.0 sourceware.org 264254BAE7CA"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 264254BAE7CA",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 264254BAE7CA",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777915382; cv=none;\n b=bSp52PDnp0x4zxsOVxivzEXJHml3r+W5kQkbDg8skTxuoAjAtel0Bu/OWLUP1e52b7r8vt6IT+vEJgqVDqXDAKubl2nn7uXpw45eIVdDfB6vWeW9m2RCjozc6tvO0qOu4hQKHmh61X59LoTlgrw2JlpSjHsXEIZ0F5utwFGoj9I=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777915382; c=relaxed/simple;\n bh=hjz9IcRNlf6g++cHvL7Y6+dLNSjraSXGZCMy1vlYU1g=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=r/O6byVQdV9Zj5jP6h6Cds1j+9r8mTNtv6sI0uM5dpsPrEU7cCo+CCUlCyWDJRJHFHodNd04NrEJYPrCnJdFcU8wgzMhVlScrBKUgoqd+phDYZErU7LC3SedLKqtPiCuOivwbVxgEgNtaC5RQ3+93MPbPZsD3Lym9O3qG9Q/nPU=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777915381;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type;\n bh=cMl3nTc8MGNgFBed6rd7GmKCl6pwLgTQgI0RJBgKf4E=;\n b=hVcoFXNai0BFxfZ01BUhXXXfy6g4qnDTZpo1XwVgGZQLdjql/0Ioxhz1zFPlR1T58WmW+6\n 5QhyQ2RDNcCdB3QTCvCCXrAjdOvCdcUJA+E1hdi7msy0jIGTp1IhN+wk74J6Gaovg1g3BH\n FPWZNgG8q463YmHLiFWNh55O+bdUaIg=",
        "X-MC-Unique": "hanoiJObO3infRr59eYzFg-1",
        "X-Mimecast-MFC-AGG-ID": "hanoiJObO3infRr59eYzFg_1777915379",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777915379; x=1778520179;\n h=subject:from:to:content-language:user-agent:mime-version:date\n :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=JuRg6nZtJo9K42QgEoP6s+VzvGnLi3lnt3bJpXyIz3g=;\n b=qnl2yed/7VjDcdldzw22jWxoyweX2rVlWGFs9O4Sln9fBWT+hVw1im6kODFi8O5+BL\n UD2TOMLS5zXjfTgAlLaazTfTYk+TKzLo/KC3qVVaezGsBaV1M009eYC6PrL004xRbFdl\n aqBs8G7lYGtk4ZYlOkw3+49Eg/3n/2d9q5EI2cV0kRjCI7XDB9ajp4rRDFQuhnG7weJc\n 3EXny4Y3NanH1GGHdUG9t+QG41EV/uoDIiUarWwTBuBVuBtKqFHRNyEo8rtiHdJnpsnv\n EiOKbHHq8g56MtxNxVFVEgJu3zEzjPxYpBV+dDhAr5uK1yQuPk95R3qq+opWPsZ4nmzd\n T5hA==",
        "X-Gm-Message-State": "AOJu0Yw/obBkbgHf/DJIBRg0hPGuzho+jqXdjV9AbQHeMU8vorSqmaqG\n xPxwmjp7qCH3q8bQQLl0skUXeSswgbj0+S1A8hkeUehg3ZT2QQHtJroODhoVxhRWjEcx9XMt1xN\n HW5bDuoEOKfiq0/MrNLJvzZdtCfsTJhoYuAUrYFtEQ8OUHhzODhhOHAzz6HCeUhZXr3XITy5t0M\n S/dg/03YKqcRLbaKV9YdNC48OiCSx5Ax5zFrTPuIT0+JQ=",
        "X-Gm-Gg": "AeBDietWECSIJa6jZjn5fuIyd/7Ipj+PDSS6KQruaEtSO8xAmg3R5FLvaKfURxlsM/z\n bHfiDcFJtJfJesetCB8yo1XXXNfg1M68NGOeDFT3uEDTJ6tdCb/yMXlJK29K3qpf0+QLwc+Afr0\n fxP14MqdMSrmh9eWhTCAqHD+VerRjefeIZ50uP+klqudTZPf651uDjOwSqzOww9EpFlugR6/avP\n gspxNkj/z8IyHhnqlJ94/ahrE/QffjLyYrc8zH3pOy229t5eY9EKQ8CVu+Z2bwemk0scCQOlTGC\n GQSd5qD0yA3PaTuQiXJKZ4b99SvlWxhgD/bsv+cE14XlI4Fp742wV++KrJ+Bfvs3hzXzYGUPDMt\n iac9jZqG3H3GKcC7JjdEYbBN69pIhjn06MKg=",
        "X-Received": [
            "by 2002:a05:622a:2b06:b0:50f:bd79:2643 with SMTP id\n d75a77b69052e-5104bf0a262mr158244531cf.34.1777915379060;\n Mon, 04 May 2026 10:22:59 -0700 (PDT)",
            "by 2002:a05:622a:2b06:b0:50f:bd79:2643 with SMTP id\n d75a77b69052e-5104bf0a262mr158243971cf.34.1777915378483;\n Mon, 04 May 2026 10:22:58 -0700 (PDT)"
        ],
        "Message-ID": "<9d58dc6e-c551-4842-ab46-6073f598b1ba@redhat.com>",
        "Date": "Mon, 4 May 2026 13:22:56 -0400",
        "MIME-Version": "1.0",
        "User-Agent": "Mozilla Thunderbird",
        "To": "gcc-patches <gcc-patches@gcc.gnu.org>",
        "From": "Andrew MacLeod <amacleod@redhat.com>",
        "Subject": "[PATCH] Handle integer constants up front.",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "RlT2GRW_23Sinbea7OTEkiaoF-mJDRXh8D_RE8YHBcg_1777915379",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "multipart/mixed; boundary=\"------------orSQ0z2U07xCmTJa6nCjSNqj\"",
        "Content-Language": "en-US",
        "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>",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "get_maxval_strlen () in gimple-fold.cc creates a bitmap for \nget_range_strlen to use.  If an integer constant is passed in, it \ncreates a a lot of overhead for no real reason.\n\nI also have upcoming uses of it which, although I don't have it in front \nof me, also wasn't working properly for the constant path.\n\nThis patch simply checks for the constant condition up front, and \nreturns the value which would have been returned had the \nget_range_strlen been called. I note that +INF is a special case and is \nsuppose to return NULL_TREE, which is what this patch also does.\n\nBootstrapped on x86_64-pc-linux-gnu with no regressions. Is this OK for \ntrunk?\n\nAndrew",
    "diff": "From 8aeb27ad66ba2a7fd86155d541293c62fd0f0763 Mon Sep 17 00:00:00 2001\nFrom: Andrew MacLeod <amacleod@redhat.com>\nDate: Mon, 15 Dec 2025 16:26:19 -0500\nSubject: [PATCH 07/16] Handle integer constants up front\n\nIf passed an integer constant, return that constant.\n\n\t* gimple-fold.cc (get_maxval_strlen): Return the same value if\n\tpassed a constant, special casing -1.\n---\n gcc/gimple-fold.cc | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc\nindex e9019e2c7bd..e92dae26dce 100644\n--- a/gcc/gimple-fold.cc\n+++ b/gcc/gimple-fold.cc\n@@ -2012,6 +2012,16 @@ get_maxval_strlen (tree arg, strlen_range_kind rkind, tree *nonstr = NULL)\n   /* A non-null NONSTR is meaningless when determining the maximum\n      value of an integer ARG.  */\n   gcc_assert (rkind != SRK_INT_VALUE || nonstr == NULL);\n+\n+  // If arg is already a constant, simply return it.\n+  if (TREE_CODE (arg) == INTEGER_CST && rkind == SRK_INT_VALUE\n+      && tree_int_cst_sgn (arg) >= 0)\n+    {\n+      if (!integer_all_onesp (arg))\n+\treturn arg;\n+      return NULL_TREE;\n+    }\n+\n   /* ARG must have an integral type when RKIND says so.  */\n   gcc_assert (rkind != SRK_INT_VALUE || INTEGRAL_TYPE_P (TREE_TYPE (arg)));\n \n-- \n2.45.0\n\n",
    "prefixes": []
}