get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2232501,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2232501/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/89a10d52-e754-4022-9bbc-2e97a34e1548@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": "<89a10d52-e754-4022-9bbc-2e97a34e1548@redhat.com>",
    "date": "2026-05-04T15:49:24",
    "name": "[COMMITTED,3/6] update_range_info can mark a statement for recalculation.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c4b9846acf6b4f24f1fa17e639386e0a8d40b7a8",
    "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/89a10d52-e754-4022-9bbc-2e97a34e1548@redhat.com/mbox/",
    "series": [
        {
            "id": 502687,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502687/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=502687",
            "date": "2026-05-04T15:49:11",
            "name": "[COMMITTED,1/6] get_tree_range should check the supplied range type.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502687/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2232501/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2232501/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=B55wIyOQ;\n\tdkim-atps=neutral",
            "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;\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=B55wIyOQ",
            "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.133.124"
        ],
        "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 4g8R303w22z1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 01:51:40 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7E7204BAE7C6\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  4 May 2026 15:51:38 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id AFE2D4BAE7E1\n for <gcc-patches@gcc.gnu.org>; Mon,  4 May 2026 15:49:29 +0000 (GMT)",
            "from mail-qk1-f199.google.com (mail-qk1-f199.google.com\n [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-320-KTwJyJ5SPSKfWEPcBvzC9A-1; Mon, 04 May 2026 11:49:27 -0400",
            "by mail-qk1-f199.google.com with SMTP id\n af79cd13be357-8eaaf673eb4so956975185a.2\n for <gcc-patches@gcc.gnu.org>; Mon, 04 May 2026 08:49:27 -0700 (PDT)",
            "from [192.168.49.94] ([68.179.25.249])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8fc29a7a627sm1102232285a.17.2026.05.04.08.49.24\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 08:49:25 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 7E7204BAE7C6",
            "OpenDKIM Filter v2.11.0 sourceware.org AFE2D4BAE7E1"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org AFE2D4BAE7E1",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org AFE2D4BAE7E1",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777909769; cv=none;\n b=jaYTrAaTDaKZxOvyfo9J48c0zXzXy1DCExnWlCFgywyV/X/DiH9dPI37/2Mh2wIb09MN8Z1jgpbTeci2Q0gqc333ALjdWP01Wxn7kEQYLlFeKuggrx2Werk9wMhDRYijBTFCfr+KJ2ts1yVEph+iIf30s1AjW9zC5Oae2EudSJc=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777909769; c=relaxed/simple;\n bh=jo13IJhIVYGQLiB8ljWeINu3dydfMQRF7YgLmZ5HVlc=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=XDBHO/R2w5CxnD6qG5RIyyilbbxFJcopxI0VjrRAMRejQYEEuF4Qxg685bDUHB7lhi7at+8jFIlhWMbUAvnwqLirtyC79jy+yqLSCZOeXCe+sWBz4REsg7Jq1v8oHw/wtkrNxmMv3IyrU0IDrz3Yz3Yqh49Xhadv5sU/fdadfKQ=",
        "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=1777909769;\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=t5YV23+39i+uG4NvLzrqM97gsgcfMJizslwrl5FOGHg=;\n b=B55wIyOQSsV08Uu1zBbWUudRhJ2LnaaKEIjOVAw01CP6YBjMKRwOcEdL4HqkHSd5PkM7Gc\n ocqTkD2WHg5RYutWyVDxanGsRscDrM0T6KqSlV3QYGH6tqZ/7H0ydTOpJgK5zHKigObDP3\n oJCjflhESKVSimy6pHFanQuTuTVvsfA=",
        "X-MC-Unique": "KTwJyJ5SPSKfWEPcBvzC9A-1",
        "X-Mimecast-MFC-AGG-ID": "KTwJyJ5SPSKfWEPcBvzC9A_1777909767",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777909767; x=1778514567;\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=fq1F/AMtITQ3n0D/QoDJ0kEMJMBCIe7oZ3IGOM7jUw8=;\n b=o40q3rLANNviAXcmQ4vocOdSt4TA+H708GwYulYoLMq8zxiUdv8hbRxSwV4vgIaeQJ\n ZiBJSSOjNS88Tv3Ar/pSRTkao1uHoiW1v8ObQdz9cm1ub5DLyOpLjIkMRrF4M+lOnQbq\n f/OqRs7WWKCdiN7XqnrWUsF53JkPgnsFmnhUb6fe2vQ0+Z4lGop9gwLsA7wYyS+YhRtT\n Xsyn+mOLMlaziFSOaiz4R8KmlGss6fczgaF2PhtdejbduazVtYncXVKpqsRNI+BPBuML\n a8gkeg+TvOvissSEraO1Kt6ZTOAZy2hJf9tmKM+H8xuLfMYnSSwt5GqvzzphMkkwHau2\n XFAQ==",
        "X-Gm-Message-State": "AOJu0YyadoO7bEYnY6oyUBHHlHwhPW+RykMQy8AXjTlzzKXYEBwaDYcd\n Xv7o7U8w0ndUb7DX6CH8sHqCju9Gfnh1ExHdFKtJ2FIna+VCXaufGFFdetxOt3FJ1HMyql+FVDw\n 8OLsuO9aoSOsoO78OhVK3u8t9gBynzpmrw8ZYNjGXQMDr/EfEbEMnlHMr1MvizSfkDEM1p2MfFS\n Y3r/HIsIfr8o3CTjl8XWED/K5l08Fwr73Aejgypvd8VC4=",
        "X-Gm-Gg": "AeBDievZrPDhKiO7KZA2stAYC4xz7uMl+y4PieHWWpHuCqnmgygp9dbm7O3nVYDyg/y\n odt8KhmME4m9XvUPTCk4WVq9U3RuOcnNitGuU6VOUEedZvgZhGu2jUPC1O6ZZkIIG5k5NUvCLMI\n 9f1EiJ6ENXvX/9H5d5Zu0YF4xtLbLOyXLoa0pp97K0MKCNUAMDYEcIHeyGxSrR5gI5PmCLd+dmW\n 7zS07QLdf5Rdp95fQwpUmJeN+Og+WjZLgpXsbh3CTa6LLgQ4wHWCJBVmZibxJp13I2PoQ51uNSu\n IkWF000jjRscRGLh35eWHRSminMutbKLe5cXv8FWHWoTJDQm7aYbHLpLf0WaRuE2o1HrBZN0SAx\n tIVlfuj4SNfHC0EX/EQCQjfUmwJ3duebC/rE=",
        "X-Received": [
            "by 2002:a05:620a:bc7:b0:8cd:9665:9eff with SMTP id\n af79cd13be357-8fd15fccfb2mr1452680785a.21.1777909766424;\n Mon, 04 May 2026 08:49:26 -0700 (PDT)",
            "by 2002:a05:620a:bc7:b0:8cd:9665:9eff with SMTP id\n af79cd13be357-8fd15fccfb2mr1452673485a.21.1777909765769;\n Mon, 04 May 2026 08:49:25 -0700 (PDT)"
        ],
        "Message-ID": "<89a10d52-e754-4022-9bbc-2e97a34e1548@redhat.com>",
        "Date": "Mon, 4 May 2026 11:49:24 -0400",
        "MIME-Version": "1.0",
        "User-Agent": "Mozilla Thunderbird",
        "To": "gcc-patches <gcc-patches@gcc.gnu.org>",
        "From": "Andrew MacLeod <amacleod@redhat.com>",
        "Subject": "[COMMITTED 3/6] update_range_info can mark a statement for\n recalculation.",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "W3QhFxjepSlmKlAPlCQk9LZ47cxR-qyrIMh8zhunpVg_1777909767",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "multipart/mixed; boundary=\"------------v0Rfzj7vsbPGuNL1FOEcuYvF\"",
        "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": "there is an entry point in a range_query object to update an ssa-name to \na specific  range outside of ranger.  :\n\n       virtual void update_range_info (tree name, const vrange &r);\n\nThis Patch provides another entry point which indicates that a global \nrange may be out of date, and should be recalculated next time it is \nencountered.  It will mark the SSA name as \"stale\", and if it is used \nagain, it will trigger a recalculation by ranger and it will check if \nthe new value is different or not.\n\nThis is then hooked into gimple_set_modified() so that if a statement is \nrewritten by any other component, ranger will now be aware. If the LHS \nof the statement is subsequently used, ranger will re-evaluate the new \nstatement which was created.\n\nBootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.\n\nAndrew",
    "diff": "From 9237613db491e8f47a22d6f07e00c3e534d52a1f Mon Sep 17 00:00:00 2001\nFrom: Andrew MacLeod <amacleod@redhat.com>\nDate: Wed, 3 Dec 2025 13:24:11 -0500\nSubject: [PATCH 3/6] update_range_info can mark a statement for recalculation.\n\nAdd an alternative update_range_info method which marks the SSA_NAME as\n\"to be recalcualted\" the next time it is used.\n\n\t* gimple-range-cache.cc (ranger_cache::ranger_cache): Allocate bitmap.\n\tranger_cache::~ranger_cache): Free bitmap.\n\t(ranger_cache::mark_stale): New.\n\t(ranger_cache::get_global_range): Check if NAME is marked stale.\n\t* gimple-range-cache.h (ranger_cache::mark_stale): New.\n\t* gimple-range.cc (gimple_ranger::update_range_info): New variant.\n\t* gimple-range.h (update_range_info): New prototype.\n\t* gimple.h (gimple_set_modified): Call update_range_info.\n\t* value-query.cc (range_query::update_range_info): New variant.\n\t* value-query.h (range_query::update_range_info): New prototype.\n---\n gcc/gimple-range-cache.cc | 20 ++++++++++++++++++++\n gcc/gimple-range-cache.h  |  2 ++\n gcc/gimple-range.cc       | 13 ++++++++++++-\n gcc/gimple-range.h        |  1 +\n gcc/gimple.h              | 14 +++++++++++++-\n gcc/value-query.cc        |  6 ++++++\n gcc/value-query.h         |  3 +++\n 7 files changed, 57 insertions(+), 2 deletions(-)\n\ndiff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc\nindex 380590b6dca..02af482838d 100644\n--- a/gcc/gimple-range-cache.cc\n+++ b/gcc/gimple-range-cache.cc\n@@ -1019,10 +1019,12 @@ ranger_cache::ranger_cache (int not_executable_flag, bool use_imm_uses)\n \tgori_ssa ()->exports (bb);\n     }\n   m_update = new update_list ();\n+  m_stale = BITMAP_ALLOC (NULL);\n }\n \n ranger_cache::~ranger_cache ()\n {\n+  BITMAP_FREE (m_stale);\n   delete m_update;\n   destroy_infer_oracle ();\n   destroy_relation_oracle ();\n@@ -1064,6 +1066,17 @@ ranger_cache::get_global_range (vrange &r, tree name) const\n   return false;\n }\n \n+// Mark NAME as stale.  The next query of NAME forces a recalculation.\n+\n+void\n+ranger_cache::mark_stale (tree name)\n+{\n+  // Only mark it as stale if it has been processed. If it has no range\n+  // it will be calculated at the next request anyway.\n+  if (m_globals.has_range (name))\n+    bitmap_set_bit (m_stale, SSA_NAME_VERSION (name));\n+}\n+\n // Get the global range for NAME, and return in R.  Return false if the\n // global range is not set, and R will contain the legacy global value.\n // CURRENT_P is set to true if the value was in cache and not stale.\n@@ -1102,6 +1115,13 @@ ranger_cache::get_global_range (vrange &r, tree name, bool &current_p)\n       m_globals.set_range (name, r);\n     }\n \n+  // If NAME is out of date, clear the bit and mark as not current.\n+  if (bitmap_bit_p (m_stale, SSA_NAME_VERSION (name)))\n+    {\n+      bitmap_clear_bit (m_stale, SSA_NAME_VERSION (name));\n+      current_p = false;\n+    }\n+\n   // If the existing value was not current, mark it as always current.\n   if (!current_p)\n     m_temporal->set_always_current (name, true);\ndiff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h\nindex 9e01005016e..e01f35a548d 100644\n--- a/gcc/gimple-range-cache.h\n+++ b/gcc/gimple-range-cache.h\n@@ -111,6 +111,7 @@ public:\n   bool get_global_range (vrange &r, tree name) const;\n   bool get_global_range (vrange &r, tree name, bool &current_p);\n   void set_global_range (tree name, const vrange &r, bool changed = true);\n+  void mark_stale (tree name);\n   void update_consumers (tree name);\n   range_query &const_query () { return m_globals; }\n \n@@ -143,6 +144,7 @@ private:\n \n   vec<basic_block> m_workback;\n   class update_list *m_update;\n+  bitmap m_stale;\n };\n \n #endif // GCC_SSA_RANGE_CACHE_H\ndiff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc\nindex 4c768ed3a07..a65d626b43c 100644\n--- a/gcc/gimple-range.cc\n+++ b/gcc/gimple-range.cc\n@@ -556,6 +556,14 @@ gimple_ranger::register_transitive_inferred_ranges (basic_block bb)\n     }\n }\n \n+// Indicate NAME should have its range recalculated next time it is used.\n+\n+void\n+gimple_ranger::update_range_info (tree name)\n+{\n+  m_cache.mark_stale (name);\n+}\n+\n // This is called to update ranger's concept of a global value for NAME\n // with range R by an outside entity.\n \n@@ -565,7 +573,10 @@ gimple_ranger::update_range_info (tree name, const vrange &r)\n   value_range current (TREE_TYPE (name));\n   m_cache.get_global_range (current, name);\n   if (current.intersect (r))\n-    m_cache.set_global_range (name, current, true);\n+    {\n+      m_cache.set_global_range (name, current, true);\n+      m_cache.mark_stale (name);\n+    }\n }\n \n // This routine will export whatever global ranges are known to GCC\ndiff --git a/gcc/gimple-range.h b/gcc/gimple-range.h\nindex 77e1bb9efd8..b7df438e369 100644\n--- a/gcc/gimple-range.h\n+++ b/gcc/gimple-range.h\n@@ -54,6 +54,7 @@ public:\n   virtual bool range_on_edge (vrange &r, edge e, tree name) override;\n   virtual bool range_on_entry (vrange &r, basic_block bb, tree name) override;\n   virtual bool range_on_exit (vrange &r, basic_block bb, tree name) override;\n+  virtual void update_range_info (tree) override;\n   virtual void update_range_info (tree, const vrange &) override;\n   void export_global_ranges ();\n   virtual void dump (FILE *f) override;\ndiff --git a/gcc/gimple.h b/gcc/gimple.h\nindex 2484a33f476..83722100849 100644\n--- a/gcc/gimple.h\n+++ b/gcc/gimple.h\n@@ -24,6 +24,9 @@ along with GCC; see the file COPYING3.  If not see\n \n #include \"tree-ssa-alias.h\"\n #include \"gimple-expr.h\"\n+#include \"bitmap.h\"\n+#include \"value-range.h\"\n+#include \"value-query.h\"\n \n typedef gimple *gimple_seq_node;\n \n@@ -2309,7 +2312,16 @@ inline void\n gimple_set_modified (gimple *s, bool modifiedp)\n {\n   if (gimple_has_ops (s))\n-    s->modified = (unsigned) modifiedp;\n+    {\n+      s->modified = (unsigned) modifiedp;\n+      // Mark the LHS as out of date with the current range query.\n+      if (modifiedp)\n+\t{\n+\t  tree def = gimple_get_lhs (s);\n+\t  if (def && TREE_CODE (def) == SSA_NAME)\n+\t    get_range_query (cfun)->update_range_info (def);\n+\t}\n+    }\n }\n \n \ndiff --git a/gcc/value-query.cc b/gcc/value-query.cc\nindex 5fbe8f932a6..3f50e31a9f4 100644\n--- a/gcc/value-query.cc\n+++ b/gcc/value-query.cc\n@@ -66,6 +66,12 @@ range_query::range_of_stmt (vrange &r, gimple *stmt, tree name)\n   return false;\n }\n \n+// Default for updating range info is to do nothing.\n+void\n+range_query::update_range_info (tree)\n+{\n+}\n+\n // Default for updating range info is to do nothing.\n void\n range_query::update_range_info (tree, const vrange &)\ndiff --git a/gcc/value-query.h b/gcc/value-query.h\nindex 3cbe0314cef..7756e431155 100644\n--- a/gcc/value-query.h\n+++ b/gcc/value-query.h\n@@ -75,6 +75,9 @@ public:\n   virtual bool range_on_entry (vrange &r, basic_block bb, tree expr);\n   virtual bool range_on_exit (vrange &r, basic_block bb, tree expr);\n \n+  // Indicate that NAME should be considered for a range update.\n+  virtual void update_range_info (tree name);\n+  // Provide a specific range update to NAME.\n   virtual void update_range_info (tree name, const vrange &r);\n \n   inline class relation_oracle &relation () const  { return *m_relation; }\n-- \n2.45.0\n\n",
    "prefixes": [
        "COMMITTED",
        "3/6"
    ]
}