{"id":2232512,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2232512/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/a647e4de-461b-478f-adeb-8a4e2d2d5fc5@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":"<a647e4de-461b-478f-adeb-8a4e2d2d5fc5@redhat.com>","date":"2026-05-04T15:49:30","name":"[COMMITTED,4/6] Unify range_of_address with other range_of_* routines.","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"4ac896b116c98dc3447d38d1dbc3ec2669fac529","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/a647e4de-461b-478f-adeb-8a4e2d2d5fc5@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/2232512/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232512/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=IDSq3xmW;\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=IDSq3xmW","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 4g8R4s4RjWz1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 01:53:17 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 895B04BAD15A\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  4 May 2026 15:53:15 +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 6A1144BAD17A\n for <gcc-patches@gcc.gnu.org>; Mon,  4 May 2026 15:49:35 +0000 (GMT)","from mail-qk1-f198.google.com (mail-qk1-f198.google.com\n [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-473-bz8dFasWNlaAdGu3eV8SQA-1; Mon, 04 May 2026 11:49:33 -0400","by mail-qk1-f198.google.com with SMTP id\n af79cd13be357-8eb04352924so508722785a.1\n for <gcc-patches@gcc.gnu.org>; Mon, 04 May 2026 08:49:33 -0700 (PDT)","from [192.168.49.94] ([68.179.25.249])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8fc2938d20fsm1092660485a.1.2026.05.04.08.49.31\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:31 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 895B04BAD15A","OpenDKIM Filter v2.11.0 sourceware.org 6A1144BAD17A"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 6A1144BAD17A","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 6A1144BAD17A","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777909775; cv=none;\n b=O2eryH+ziw8wasA9F9gS0tloa+q56O2ikQqUH+jNZFl1WNQAZYUlGTNPjmwYrPg0PgqVmilN5IQHk75VguDr8mzzKkvtnCc0BmxQXYyam5EPF22gjm657bI2h3f7fanr/EewI+3kbPFNVQz5ZIyEhdi7Vk9hW2Q0yoKMPxM4yYk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777909775; c=relaxed/simple;\n bh=AGcIVVDZODI9Y8YBOwwqVQkowW6W7uwACOhEr0ivq5o=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=G+sMRuNDdG5YtqPpnLjRd4ZZtr8cJ7dZEzWi4GlTu8OdLQ3O/aTmvaa2NbgWhXF6a5FfBCDejziLJ1YNB6dCWglycVff7tEJ/K6Ks4I2v/5xLHHJ3Xue7kwwgTIJG0lcjqRfDW0jGd7dbiMkpEbuvIOXg6BXFOC9+nN369n9ip4=","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=1777909775;\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=GKDe30bpVD2hWPdJxMNDvIf+VIZiNyB0ekUEvBMamzs=;\n b=IDSq3xmWN/UYRWRvjWPwwpuWSXAVLyGB0TtLIRimEGMWGypacMaMV5xNvaNR7aIo2a4Bx8\n zN/xTMiPxJe6k18kaQ8gjSXtgC9IQL4rEi3+fl5PyF8KNgvyV0ytdekZvUKUZNSUz8BSky\n bWmd3bk12rTZrqdo+m6P/wLW/y+djH4=","X-MC-Unique":"bz8dFasWNlaAdGu3eV8SQA-1","X-Mimecast-MFC-AGG-ID":"bz8dFasWNlaAdGu3eV8SQA_1777909773","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777909773; x=1778514573;\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=N1vkM/9+uFnKjI8zSSCibvb9ad18RvNIRCLkhFibP2Y=;\n b=Ohojj3arLaqY600N/mSbYv35+IfGbpVlXIva+AX1ow8sykZXhiUZfP3uYcLXRKDRQI\n jmYnMQINpgeUvIiiybDMEEjEwbaSHYTAt/AcwXiOVwhxU45GJr6rR0OIT6uVE0QFQF0k\n NZDFJNJMRmKzOZ6BHWvXyyyyExUtpPThvx2lESi4mOCF2keGHK764PRd5mJXlMXGobsM\n CU1xL6desz3YlwVy4G+c5wVwpfYusb/KcuLxBpDwNxGhc8ZXLy0jX3XEiLb3lKs6C5hN\n PXF40Vu5dpHh8TK8naktjxw/vafEDoPKyjDIEZUgGai3KJY1kj5IbSU6MNkCQ0zYGx9D\n vEtA==","X-Gm-Message-State":"AOJu0YzmhL/PmEy6qHnGCGyMm/DMeT7mLNjrEx8aElkDaa1x5ZQruwEj\n eBcRt0MMRiXRB+SFf9ICo/8Ft9Kbt/72Ia8jLp5EarNJp4CdhlUGiM5q+XakUhhs/V+Hk2WhJ6R\n mvkzgKsErgfbAFsJF6U5YLa6Q56Lo9LHH9B0VfKH6xSYncda9Ld+vl1SUPZxgUAUnuYRsyrzmcs\n 2rpoiTmdRnzcmZf+g6+0HujMsEV2D9LfJFuS83/gxdrIU=","X-Gm-Gg":"AeBDieuBsn2j45u1Wn922eKuVc0BolpDXQw6PsiHOfH6eJsjOV2Il/QCQV5vHpFQnQS\n kFuw1BZTi0ZTT77nGCvE5t4JwGXR8P0DE5ppMrUYFQVduhgOaPi2bGdGe5B0/c2i7kEukF/gNWJ\n OIRCdTvt5Ynx5K+7RHpqNgOPd6swqR4CmDIgNuLktxJ1kr8pXb1dwokq+mGxlnZLofXMBtbVYMh\n 7RENR4xGXdinwGMIo+dHP21xvHGLW7cfVqUi6OfxJOscC9aR+aLhKnrfZ0WmwxiLeLcb24x7vm/\n /qgvodOx395clgEtG4lMVQshFZzrOJvn07HeEzJXSxJoe3kbRDlieiKbEpkapAOSF2wo7AET52z\n NaUl/6GrV1jGkwBORmBjEOpc4S6S6bNXAs2U=","X-Received":["by 2002:a05:620a:45a8:b0:8f8:cdd0:df80 with SMTP id\n af79cd13be357-8fd18644260mr1632602285a.59.1777909772756;\n Mon, 04 May 2026 08:49:32 -0700 (PDT)","by 2002:a05:620a:45a8:b0:8f8:cdd0:df80 with SMTP id\n af79cd13be357-8fd18644260mr1632596185a.59.1777909772116;\n Mon, 04 May 2026 08:49:32 -0700 (PDT)"],"Message-ID":"<a647e4de-461b-478f-adeb-8a4e2d2d5fc5@redhat.com>","Date":"Mon, 4 May 2026 11:49:30 -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 4/6] Unify range_of_address with other range_of_*\n routines.","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"9QKCeia9m_2yq7rqFVOlJod5cdDTbtFVQ9ayZSuOcRc_1777909773","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/mixed; boundary=\"------------TgEQbNBj2p5t8u5n0bkHDLlw\"","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":"Range_of_address was added near the start of fold_stmt(), and if it \nreturns a value, it immediately returns.\n\nThere are some minor followup processing bits that are performed before \nfold_stmt returns that it would be useful to do, so this patch simply \nmoves range_of_address () into the  same if sequences that the other \nrange_of_* () routines are in so it can also benefit from the post \nprocessing.\n\nBootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed.\n\nAndrew","diff":"From fd683d8655c653d8a1b6571a6d68bec043cc5393 Mon Sep 17 00:00:00 2001\nFrom: Andrew MacLeod <amacleod@redhat.com>\nDate: Wed, 17 Dec 2025 09:34:28 -0500\nSubject: [PATCH 4/6] Unify range_of_address with other range_of_* routines.\n\nWhen range_of_address is called, we return immeidately, missing any\npotential post calculation processing.\n\n\t* gimple-range-fold.cc (fold_using_range::fold_stmt): Move\n\trange_of_address call into nested 'if' with other routines.\n---\n gcc/gimple-range-fold.cc | 14 ++++++--------\n 1 file changed, 6 insertions(+), 8 deletions(-)\n\ndiff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc\nindex 2a968a646d2..9119765125f 100644\n--- a/gcc/gimple-range-fold.cc\n+++ b/gcc/gimple-range-fold.cc\n@@ -668,16 +668,14 @@ fold_using_range::fold_stmt (vrange &r, gimple *s, fur_source &src, tree name)\n     name = gimple_get_lhs (s);\n \n   // Process addresses and loads from static constructors.\n-  if (gimple_code (s) == GIMPLE_ASSIGN)\n-    {\n-      if (gimple_assign_rhs_code (s) == ADDR_EXPR)\n-\treturn range_of_address (as_a <prange> (r), s, src);\n-      if (range_from_readonly_var (r, s))\n-\treturn true;\n-    }\n+  if (gimple_code (s) == GIMPLE_ASSIGN && range_from_readonly_var (r, s))\n+    return true;\n \n   gimple_range_op_handler handler (s);\n-  if (handler)\n+  if (gimple_code (s) == GIMPLE_ASSIGN\n+      && gimple_assign_rhs_code (s) == ADDR_EXPR)\n+    res = range_of_address (as_a <prange> (r), s, src);\n+  else if (handler)\n     res = range_of_range_op (r, handler, src);\n   else if (is_a<gphi *>(s))\n     res = range_of_phi (r, as_a<gphi *> (s), src);\n-- \n2.45.0\n\n","prefixes":["COMMITTED","4/6"]}