{"id":2232500,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2232500/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/36b6e353-d5a8-4bb8-b5e9-2b406be95983@redhat.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","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":"<36b6e353-d5a8-4bb8-b5e9-2b406be95983@redhat.com>","date":"2026-05-04T15:49:37","name":"[COMMITTED,5/6] Ranger_cache::range_of_expr should handle no context.","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a7ebe4a5612d7e46398ef36142b4b77385521d64","submitter":{"id":7458,"url":"http://patchwork.ozlabs.org/api/1.1/people/7458/?format=json","name":"Andrew MacLeod","email":"amacleod@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/36b6e353-d5a8-4bb8-b5e9-2b406be95983@redhat.com/mbox/","series":[{"id":502687,"url":"http://patchwork.ozlabs.org/api/1.1/series/502687/?format=json","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/2232500/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232500/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=RulhBXD6;\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=RulhBXD6","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\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 4g8R2v5R4Gz1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 01:51:35 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id AE3A44BAE7E2\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  4 May 2026 15:51:33 +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 5BA6D4B9DB6F\n for <gcc-patches@gcc.gnu.org>; Mon,  4 May 2026 15:49:42 +0000 (GMT)","from mail-qk1-f200.google.com (mail-qk1-f200.google.com\n [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-587-m0GB0C2uPda-BMEWSjH8hg-1; Mon, 04 May 2026 11:49:40 -0400","by mail-qk1-f200.google.com with SMTP id\n af79cd13be357-8ee9a11aa75so916292485a.2\n for <gcc-patches@gcc.gnu.org>; Mon, 04 May 2026 08:49:40 -0700 (PDT)","from [192.168.49.94] ([68.179.25.249])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8fc2c91cd89sm1091512985a.35.2026.05.04.08.49.38\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:38 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org AE3A44BAE7E2","OpenDKIM Filter v2.11.0 sourceware.org 5BA6D4B9DB6F"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5BA6D4B9DB6F","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5BA6D4B9DB6F","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777909782; cv=none;\n b=dkMnzpDSXyfbgWN/10Q7eeB0q+ENFD/Ee897V3PwAGdsKhJjIo+rrR38fHrXZwyrU654gd5eqsPxNBm5YIRicxHizD4R7DClN1eN4guFOi3U5djV08jjr8iEoKt6LLbiEXSn8nH9sDzFTkji4JyRf1je+bGhDzJ2GrkdqDl3WLI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777909782; c=relaxed/simple;\n bh=HGJ7Kx/maCPeZOR3xevekf+Mwk0z8usPFW2e9fPPysM=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=R70L/J1jgYcymg7HQRRCMpcCOf0ZzQ5PVXpNnJYa6+fvhvJL/g2I3Zc4exFwz73A7KaNUfeukM1zw9oPt0Du/bU6Jpcsz+2Vc7wXmS65WjBpVRT5kJLi6o6Ft8my43Knw6zTbEhn8NTHGCtcaDmrK1zt9V4LtBicrWPyxZsTL5Q=","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=1777909782;\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=dtzZQM5Pmg+b99uDSiCoXFofNYWvYzF6iLOaugRux84=;\n b=RulhBXD6BwXpzMknZrvFdo7+4JmYz6tnbmr0VUWrj25NG3zd1vZWQcWGvOEiqF/IRuGDdq\n K9Qhz2qQkeZppt3LZ0xBwSpPx38vDNxk2WFmMK8IoxjviPQgnplLsRMcwFvhfVE75nJfd9\n q6R/SV6ibI4jnPrk6Y2F8AomSks1Vqg=","X-MC-Unique":"m0GB0C2uPda-BMEWSjH8hg-1","X-Mimecast-MFC-AGG-ID":"m0GB0C2uPda-BMEWSjH8hg_1777909780","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777909780; x=1778514580;\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=sqUBxFKJ7jVPE76gS52B+DcqHNkKGdv5kREJfalwrfk=;\n b=LSuRJ6YeDLO8Hqri3wouIsq/f+UxI8J7HQV1oQU9KfUuvVSENZcluGIgQyFqcNJyXM\n u6Rlx/E0pf5mN5xCYbsywMv9nkJOBGCuDcaqZVtfidfD7zAB1/l5+W8LVskDOYfZ/ywL\n tUhvNZwJn3LH4zbCNapxExwXS/LdG45mNrvIqtfkvdnjD5Y/Avqur/zrGNWShexgi5iG\n nxRiAmgEe/kpK0M78QNqBjETlmw2XEq2VYzr49zA9YSrWukhZZuMABlXBfcPCZ4zHCeO\n fDm0dIln1eJ4R7Yn8fQ0hMuR2iDQgfDiJnR+MZIKnww5Mc4uJKkI29r3QJo2VSY0syoH\n +DaQ==","X-Gm-Message-State":"AOJu0YwQ6LYzYweIgVbMQbgCylirUp7V8+4kVScVaG6p0ESCxMErr0iN\n 3TVsChMm78fGVEoJzAwUKWaQZE5XDR+eXNfZpficltGmGXI3xdkU6cNf6uVpw2fTUM2ejhRRR5p\n umkgEyDMJi6otty18SKUi4vRbKQLHRlw6MLGewLUbU2wsnybxvTmw6Wet5vB7U1YEkOkPybjpWI\n dViKcH2Pnxeh+kCWwMPLyEfdf2NMizZ8c9V6FbRRpFmqY=","X-Gm-Gg":"AeBDievlVdo7e+Em7Z96WTCiO34Ptc0gWsZ7PnZmix0Y/FtwOn4mwkyEq29obDyXDl0\n 2lzJJOut5po9FlsXJLxIQ7XT1aivhjuWxwHJhmTTprRcmHLJZLsXmmomskfR5roCUQDcnkl9ZyD\n b+Ssrds8zi5cv5TWipOT6fFZpJ1gJ6gGd8RGLlTcemNPaXqRlzyL2ZOCr23WybOmgmp2aSc8ml/\n nXvQewS0uXZAegx3fI8m3rhYbHJ7gWeEbhH0Icb5TENQEmHni+trClF/3gknIt/kmJKzecBGIrk\n vp+CqZ8DBKmLxVbykpoQ6CKmbafyTZEaa1Fr3Ew5Fmk8xpOy0WT5KzSjP9PriAEXppxmOW8IB4f\n q0LgepK8V5ipNwSxtFP5A8zjAenxz0gdZMJs=","X-Received":["by 2002:a05:620a:28ca:b0:8d7:531:cb8e with SMTP id\n af79cd13be357-8fd18434696mr1611945185a.49.1777909779686;\n Mon, 04 May 2026 08:49:39 -0700 (PDT)","by 2002:a05:620a:28ca:b0:8d7:531:cb8e with SMTP id\n af79cd13be357-8fd18434696mr1611938485a.49.1777909779011;\n Mon, 04 May 2026 08:49:39 -0700 (PDT)"],"Message-ID":"<36b6e353-d5a8-4bb8-b5e9-2b406be95983@redhat.com>","Date":"Mon, 4 May 2026 11:49:37 -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 5/6] Ranger_cache::range_of_expr should handle no context.","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"4pPa0pytmUBj-tGdf6x3YFas1RKwZeonT0iPxq-vyIA_1777909780","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/mixed; boundary=\"------------Wc7BgtW0GFviujHEVX0AeGce\"","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":"Rangers cache is implemented as a \"read-only\" range-query, but the \nrange_of_expr implementation fails to handle the case where these is no \ncontext provided.\n\nThis patch adds support for that, picking up the global value from the \ncache.\n\nBootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.\n\nAndrew","diff":"From 63b9fd7f4f6ce8b100584efea704d2f94855fd0c Mon Sep 17 00:00:00 2001\nFrom: Andrew MacLeod <amacleod@redhat.com>\nDate: Tue, 16 Dec 2025 13:44:45 -0500\nSubject: [PATCH 5/6] Ranger_cache::range_of_expr should handle no context.\n\nrange_of_expr is suppose to return a global value if there is no context\nand instead it was crashing.\n\n\t* gimple-range-cache.cc (ranger_cache::range_of_expr): Handle\n\tNULL statement.\n---\n gcc/gimple-range-cache.cc | 24 +++++++++++++-----------\n 1 file changed, 13 insertions(+), 11 deletions(-)\n\ndiff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc\nindex 02af482838d..f3aa256acb0 100644\n--- a/gcc/gimple-range-cache.cc\n+++ b/gcc/gimple-range-cache.cc\n@@ -1274,19 +1274,21 @@ bool\n ranger_cache::range_of_expr (vrange &r, tree name, gimple *stmt)\n {\n   if (!gimple_range_ssa_p (name))\n+    get_tree_range (r, name, stmt);\n+  /* If no context is provided, pick up the global value.  */\n+  else if (!stmt)\n+    get_global_range (r, name);\n+  else\n     {\n-      get_tree_range (r, name, stmt);\n-      return true;\n-    }\n-\n-  basic_block bb = gimple_bb (stmt);\n-  gimple *def_stmt = SSA_NAME_DEF_STMT (name);\n-  basic_block def_bb = gimple_bb (def_stmt);\n+      basic_block bb = gimple_bb (stmt);\n+      gimple *def_stmt = SSA_NAME_DEF_STMT (name);\n+      basic_block def_bb = gimple_bb (def_stmt);\n \n-  if (bb == def_bb)\n-    range_of_def (r, name, bb);\n-  else\n-    entry_range (r, name, bb, RFD_NONE);\n+      if (bb == def_bb)\n+\trange_of_def (r, name, bb);\n+      else\n+\tentry_range (r, name, bb, RFD_NONE);\n+    }\n   return true;\n }\n \n-- \n2.45.0\n\n","prefixes":["COMMITTED","5/6"]}