{"id":2215608,"url":"http://patchwork.ozlabs.org/api/patches/2215608/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/0998a1aa-404c-4ffd-a936-9e59c5534185@redhat.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/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,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<0998a1aa-404c-4ffd-a936-9e59c5534185@redhat.com>","list_archive_url":null,"date":"2026-03-24T19:57:15","name":"[pushed,PR124572,LRA] : Deal with generation of reload insns during elimination","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"b8e9b7366b0c8fa52c064a9ea0ee69b2d1879478","submitter":{"id":4455,"url":"http://patchwork.ozlabs.org/api/people/4455/?format=json","name":"Vladimir Makarov","email":"vmakarov@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/0998a1aa-404c-4ffd-a936-9e59c5534185@redhat.com/mbox/","series":[{"id":497343,"url":"http://patchwork.ozlabs.org/api/series/497343/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=497343","date":"2026-03-24T19:57:15","name":"[pushed,PR124572,LRA] : Deal with generation of reload insns during elimination","version":1,"mbox":"http://patchwork.ozlabs.org/series/497343/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215608/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2215608/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\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=jKOJn81L;\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=jKOJn81L","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 4fgLS14D2Hz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 06:57:53 +1100 (AEDT)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 388374BB3BF8\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 24 Mar 2026 19:57:51 +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 1C53B4BAD15F\n for <gcc-patches@gcc.gnu.org>; Tue, 24 Mar 2026 19:57:22 +0000 (GMT)","from mail-qv1-f70.google.com (mail-qv1-f70.google.com\n [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-335-msweHoReNFOpoOkj8sln_A-1; Tue, 24 Mar 2026 15:57:19 -0400","by mail-qv1-f70.google.com with SMTP id\n 6a1803df08f44-89c4a339b6bso12920846d6.0\n for <gcc-patches@gcc.gnu.org>; Tue, 24 Mar 2026 12:57:18 -0700 (PDT)","from [192.168.0.120] (192-0-141-76.cpe.teksavvy.com. [192.0.141.76])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-89cbda0f584sm15404196d6.14.2026.03.24.12.57.16\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Tue, 24 Mar 2026 12:57:16 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 388374BB3BF8","OpenDKIM Filter v2.11.0 sourceware.org 1C53B4BAD15F"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 1C53B4BAD15F","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 1C53B4BAD15F","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774382242; cv=none;\n b=OYCp/5hRubqts5HGBeAwUjFTraxBiqQRIjCb5XIFT7K+TLVT0MykqHMt+YtMSzdSYN/qU5hziDQm0h4RzT5zVnYUXndD/rlhEixBy3ISl+cfEVNEOhnwRZbe7zsEHNkW1TlrL+dAJ0nCpUYs8elcs5xzors4U3+C6wP6YKVXTwk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774382242; c=relaxed/simple;\n bh=umMs6N6HrOWOzyHh4wTMMWX+GpjBSsV7w31GTUdaWkw=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject;\n b=CZtSPCUCRhOgAgpBZ4h293VJEXGuWj6vWSOYPdZs4nqRSq2326PksjRDmAgdfsvGCJnJcRMEVq8+21Cx7vzHZEQS8pCZXZFDBF8R0Eu2Era/3okye6kMCuBzWbDfMq0r3igMojUBotbDppVFlQSUfXzdkABZjgxwQOv0OEAwAKU=","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=1774382241;\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=o9nAfl2bsITT+qZL28a89G4EzTrkcs3mN4N3CF8GZAA=;\n b=jKOJn81Lr1myBYLUGs4fz4x4WjWCo+bN7Z863I8Pg13yGYwqVyWse2z8qTK3/6Kuhj82A5\n hnAdK2OSOXfyzl7WTpsLJzEz5DKp/wbCshdnOvHoy6uU0ksDg2F9Ql7vgbLXxFtyJEwqSx\n ar/x1FuGZiY91pvqCnpZ/YraZJ28/HI=","X-MC-Unique":"msweHoReNFOpoOkj8sln_A-1","X-Mimecast-MFC-AGG-ID":"msweHoReNFOpoOkj8sln_A_1774382238","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774382238; x=1774987038;\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=b5CzvIh9m2g5+fI0taLppqBE+0SFZyqtG1y1ubkY9q8=;\n b=Ha0DOUlX5HFJzRhZUYukLkVLTrU4i3R2rXAhwXX9v+SQeKX67HFfSoBGyeBH94l9a6\n zx9uuIkZ6DibphyC47vP1EdPj2tzY7OD0ikMbYS4ecJYHgAZa7Mpz7dCTpoh5cyJz+ON\n AoxlbG7Y9TkkypxRRxZsC9Y1Xk2PwaiJGOViMV3PZ5JWze91BtwpmNgS4v2c1whjdqXU\n FLBrQTNLX7y41wGuvYCbDCqO8/n6r2CbGqHhgClct+q7TUhJNr4OgDnTL3ZMbKrBGfIq\n V9mIwcpCEodzwk2kaQZku6NwP7Bv663AY7kjU2U5ApNv8bL0pibQSCOvb+Rh8HCOijMm\n jNeA==","X-Gm-Message-State":"AOJu0Yzfx9/wwxQeZWcRfB0Py+56RkuCMK4ncd/EuxdEw+YDjt074IPp\n Hw3j2yGmJ63XMA68LOvrHrr/eAp9HNvTffesNcSPpWa2ZKncgayqS21dWEKJjakk0cTGrW9Aabe\n VIrW5GkWgvZqJV/U3Cp3+bD/adRPKYPL8Q+Kq1PRTnweAS3XkoUOSi6gR17SWx9vUfHaWuSHvn6\n cvH3r/jUw0tvWY3qVvqX0XEPX6Sx6OcVsrIGKCAAFtm6E=","X-Gm-Gg":"ATEYQzwXQipiVqqSs/wsQ7eMdKkWv1wT/2BamYvq8g76q9v/wwJT7kSvUYTCphdOOVg\n YJOB6KEDVj2i0C030UZy4ODVsQHD6gazEr6occoFiAPPlktKuMHC42nL2POreslQFXVnSPa5ZAz\n AY9H+5Zr8UxAc+l34Jz8JxgJzraScfa1akTQ4bY0HrckxqHZFdXWZUna5CYHNRTvSPPseWcUNrj\n eGu3lSU7ocfWkl3ZQVcuxqI1y5RuCOnNZ2isjfXoCEKcHDt5s2HRKBxLcm0UyNIv8YgFNCV2nwU\n XYxs0aZNhwFxgTMJbea0XcBOWKERYDrf+7rFYASDhYxS7w4w1wLNCWLgRWsJH1tK/dYQrUyrF7s\n DJU6oIvTikiGqwOwi+Ap3e9mTP0/I9319o0GveGFjbufH/ko2CPbQldo=","X-Received":["by 2002:a05:6214:2524:b0:89a:6a91:369e with SMTP id\n 6a1803df08f44-89cc4318e74mr15473906d6.31.1774382238271;\n Tue, 24 Mar 2026 12:57:18 -0700 (PDT)","by 2002:a05:6214:2524:b0:89a:6a91:369e with SMTP id\n 6a1803df08f44-89cc4318e74mr15473606d6.31.1774382237731;\n Tue, 24 Mar 2026 12:57:17 -0700 (PDT)"],"Message-ID":"<0998a1aa-404c-4ffd-a936-9e59c5534185@redhat.com>","Date":"Tue, 24 Mar 2026 15:57:15 -0400","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","To":"\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>","From":"Vladimir Makarov <vmakarov@redhat.com>","Subject":"[pushed][PR124572, LRA]: Deal with generation of reload insns during\n elimination","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"78XTZeJgA8NXeRsy_QSQPW0Dbz0EagKbbipPTJ2bjDs_1774382238","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/mixed; boundary=\"------------tUdNPDp2t6sXnz57iRZXwFyZ\"","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":"The patch fixes\n\nhttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=124572\n\nThe patch was successfully bootstrapped and tested on x86-64, aarch64, \nppc64le.","diff":"commit f70cad865a1fb7d8719a80b2e23b6380b9f7701a\nAuthor: Vladimir N. Makarov <vmakarov@redhat.com>\nDate:   Tue Mar 24 09:05:59 2026 -0400\n\n    [PR124572, LRA]: Deal with generation of reload insns during elimination\n    \n    It was assumed that elimination in LRA does not generate new reload\n    insns.  In the testcase the elimination of SFP subreg generates reload\n    insn of the subreg and this insn is added at end of RTL code.  The insn\n    is also skipped for necessary processing.  This results in ICE.  The patch\n    checks creation of reloads insn during elimination, insert them in the right\n    place, and add them for later processing.\n    \n    gcc/ChangeLog:\n    \n            PR rtl-optimization/124572\n            * lra-eliminations.cc (lra_eliminate): Push new reload insns for\n            eliminations in insns.\n    \n    gcc/testsuite/ChangeLog:\n    \n            PR rtl-optimization/124572\n            * gcc.target/aarch64/pr124572.c: New.\n\ndiff --git a/gcc/lra-eliminations.cc b/gcc/lra-eliminations.cc\nindex 8e68cb70dcf..e2a6ebfff16 100644\n--- a/gcc/lra-eliminations.cc\n+++ b/gcc/lra-eliminations.cc\n@@ -1544,8 +1544,19 @@ lra_eliminate (bool final_p, bool first_p)\n   EXECUTE_IF_SET_IN_BITMAP (&insns_with_changed_offsets, 0, uid, bi)\n     /* A dead insn can be deleted in process_insn_for_elimination.  */\n     if (lra_insn_recog_data[uid] != NULL)\n-      process_insn_for_elimination (lra_insn_recog_data[uid]->insn,\n-\t\t\t\t    final_p, first_p);\n+      {\n+\trtx_insn *insn = lra_insn_recog_data[uid]->insn;\n+\tstart_sequence ();\n+\tprocess_insn_for_elimination (insn, final_p, first_p);\n+\trtx_insn *first = get_insns ();\n+\tend_sequence ();\n+\tif (first != NULL)\n+\t  {\n+\t    lra_assert (!final_p);\n+\t    lra_process_new_insns (insn, first, NULL,\n+\t\t\t\t   \"Inserting elimination insn\", true);\n+\t  }\n+      }\n   bitmap_clear (&insns_with_changed_offsets);\n \n lra_eliminate_done:\ndiff --git a/gcc/testsuite/gcc.target/aarch64/pr124572.c b/gcc/testsuite/gcc.target/aarch64/pr124572.c\nnew file mode 100644\nindex 00000000000..edadfc3da79\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/aarch64/pr124572.c\n@@ -0,0 +1,10 @@\n+/* { dg-do compile } */\n+/* { dg-options \"-O2\" } */\n+\n+int e() {\n+  char f;\n+  long tt = (long)&f;\n+  tt+=1;\n+  int g = tt;\n+  return g + 3;\n+}\n","prefixes":["pushed","PR124572","LRA"]}