{"id":2228025,"url":"http://patchwork.ozlabs.org/api/patches/2228025/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/a533fcbd-de94-4444-856c-ad7ab93c4251@oss.qualcomm.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":"<a533fcbd-de94-4444-856c-ad7ab93c4251@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-24T20:45:30","name":"[to-be-committed,RISC-V,PR,target/124984] Fix RTL checking abort in thead memory address classification","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9a43923edc4b59fd36458b6379a751dea281a9dd","submitter":{"id":92310,"url":"http://patchwork.ozlabs.org/api/people/92310/?format=json","name":"Jeffrey Law","email":"jeffrey.law@oss.qualcomm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/a533fcbd-de94-4444-856c-ad7ab93c4251@oss.qualcomm.com/mbox/","series":[{"id":501405,"url":"http://patchwork.ozlabs.org/api/series/501405/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501405","date":"2026-04-24T20:45:30","name":"[to-be-committed,RISC-V,PR,target/124984] Fix RTL checking abort in thead memory address classification","version":1,"mbox":"http://patchwork.ozlabs.org/series/501405/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228025/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228025/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 (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=geqzVU0l;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=Qr+6sFCB;\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 (2048-bit key,\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=geqzVU0l;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=Qr+6sFCB","sourceware.org; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com","sourceware.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com","server2.sourceware.org;\n arc=none smtp.remote-ip=205.220.168.131"],"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 4g2Q4Q0KxMz1yHS\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 06:47:00 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id C08E04B920EC\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 20:46:58 +0000 (GMT)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\n by sourceware.org (Postfix) with ESMTPS id 6A9764B920E5\n for <gcc-patches@gcc.gnu.org>; Fri, 24 Apr 2026 20:45:34 +0000 (GMT)","from pps.filterd (m0279867.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63OGucCt3340782\n for <gcc-patches@gcc.gnu.org>; Fri, 24 Apr 2026 20:45:33 GMT","from mail-dy1-f198.google.com (mail-dy1-f198.google.com\n [74.125.82.198])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dr6kptes4-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <gcc-patches@gcc.gnu.org>; Fri, 24 Apr 2026 20:45:33 +0000 (GMT)","by mail-dy1-f198.google.com with SMTP id\n 5a478bee46e88-2ddd8ef5343so8012773eec.1\n for <gcc-patches@gcc.gnu.org>; Fri, 24 Apr 2026 13:45:33 -0700 (PDT)","from [172.31.0.17] ([136.38.201.137])\n by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2e53ac84c38sm34533351eec.13.2026.04.24.13.45.31\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Fri, 24 Apr 2026 13:45:31 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org C08E04B920EC","OpenDKIM Filter v2.11.0 sourceware.org 6A9764B920E5"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 6A9764B920E5","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 6A9764B920E5","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777063534; cv=none;\n b=usva3+w2MjfN3R4FG81T5TfCBdFt0JLQQoFLWUb0uA/b0Cn4w9HR/WlWxsZgAhapyI4p6AdkzUiavYSf8n/M3VpuTFKjeJJnnfmxVFQxdU39xdGJhxSjC1Hxivaz4x8pn0tmBG2QWYuFwpuRt55QTJbklCjlGpHPg8NuDJURytc=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777063534; c=relaxed/simple;\n bh=n8nA+didW5QkPrS4GCRAxos1JI/JY8w56+mxAc5H8ts=;\n h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:To:\n From:Subject;\n b=dC5hQdlpwP05enhKQ6GUToylQ3cuCe3Jo6xCftiPclLPKtU0pTnJDiRhSbZdiKMCwH34XOMem56nwUy4foe8IPiQONXA3+z9Yh7xqsVdq5pY9RGZ04tyQDO6eTgf2vKhM4lZmCMTM4riYPz1Xmeps5n5KEFmhvHGim7YV2ZgEas=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n content-type:date:from:message-id:mime-version:subject:to; s=\n qcppdkim1; bh=owjCeUmCQMmDEwujDPrbCMLQ1Nr82vcwL/bvpmxe0QI=; b=ge\n qzVU0lDyE2ojhu89wiT7tDOhapLmGnBsIvIdvtGgdfswYgM9sBBNO5g2Ammdh8wF\n 8t7xS6BCM7HXAWRZaOsjE8H9iMrCvFDk81ouPswwXfAxoglD00ELgWNIN5yamgqU\n AvUNhnvvgXPTHy5YozvWi1KH2P/FJNbRbuGvrF2wyJPL2YMBMKXRmvITEYGN9vml\n kkviymKd92YbU0DTy4ReA7nA3NdW8MnxwAbsBqA2uVLe/Mcr8BFWGukvo9k3gNo7\n H6faUxyj08BKoD6Xtc8R7nI+RDtKqLPfQO0yC5dsb9rM9WpkEm+JhehOXqau1pT/\n z3oGVYQIC0tCGOl14l7A==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1777063532; x=1777668332; darn=gcc.gnu.org;\n h=subject:from:to:content-language:user-agent:mime-version:date\n :message-id:from:to:cc:subject:date:message-id:reply-to;\n bh=owjCeUmCQMmDEwujDPrbCMLQ1Nr82vcwL/bvpmxe0QI=;\n b=Qr+6sFCBFn2HdE420hArrVa/5LhzZMqEA66rccVwAUAWQqHK4xkupEcHcZ5A+VeGMr\n sPvhTCCI/8SSQMByrByrUbCT6xTbibNdvNBNbaDaVIy3QmI+rkp9VKVdijqKsEuVmdwk\n 3NuTbaKFMMXub//lMa61stYfMKI1Q818n4V5TaGxol03Hjv9wqqYB+dTLxcoh4M7oOuH\n CAasUbR92w3Cu6sWRcVJF0TWHjMuhrfM+xm4mHCFk3hDsZ+UDF5Qs4PNoJIC8JZE4+7G\n 9o7kqvqStQeobsO2Mx+bj+7lL4IV3ALNF2cB9o8HkL9JNZfWkN9fmQCdkyXWq2eN93/v\n dlJg=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777063532; x=1777668332;\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=owjCeUmCQMmDEwujDPrbCMLQ1Nr82vcwL/bvpmxe0QI=;\n b=SSdzKhvgdpHcceZRuUTAZrudi1qPlitAlMMEs1h4lwMHNMVsvwNrXu3CCllRBJ2dvW\n EoPMHqRY0OVZFLU4OzvSLT4SIc4uhjz4WXvkuuGo76ncz/y0rU4Ps8apu/kBkDRopAuB\n X3my1/l9eI+F+dBsSxbfOHR6EpS+SBFmmZkPuYfI2mjxOUxnh5qp1O44oQxfH4ugf6DB\n yrIk4dWfeQg4p2WYST+St+ypiakWnp5eHbpRTYPaw/fuearqhyVfbxizII6PxI/kEcMl\n 9vcG4wBYj30y/6FS4MZLXjv/6MGD/pPVf+epjmO3KnKQkIwnuj6kombrffA2Wz6wshfT\n oKlw==","X-Gm-Message-State":"AOJu0Yzc8+4pkvz5izGfA26X69g5LbpWG+znAI4PI4VXf/uHw/dIaO+J\n hwCfZto64QIvdAXgix3IkZT9gmusWQ3/RX2MH+p3aoZjOatSTXgZceucdZ8LczJnF1W3A2x3unw\n DNbXvZBQFrXN/ep3EhldBFDe6ucpcMJAxWR5KwZloPcrgsZ7PdPtEmYkntopR1TtaN3xc","X-Gm-Gg":"AeBDiev08WPZ9ZZhEVNIRmewn1F0SzKOY/e7hq+c3JhBBWxJ19Hb7idxfAmaHyjKIB/\n wqHr/J/qfRKBedYvaQZmPT4EH8j9KBKEt9m5ZUKuvZFFvF42XIZfEgx2OzQsf9fFvFw1SOyXYmd\n Piey9SFKTKq2DHrfLQo4WfPKfqlzD9fTbyaFx54L2QS0m1fBXcqdEEW2j7FN7CYZ8SEOuulnXe2\n Ge0OlKJVUSKD1H28UlJiRnV2J3OhvT35OdoDbaW9aNrkyt9VLtZqu/aJFskiaNpmVZckbdcS44K\n kOQs4x0SbcT1sdRHqOVZJwy+eClt/n//GjHSLj/dC8rAFU4laeEnsf9f/x1vcmVWe84QyFeilxj\n keZuZPAueWKMB7FKDwyQ1Jpzb8awIe+jVVztMc6YCrnnYyZvfiNnIoLnBjb69","X-Received":["by 2002:a05:7300:6413:b0:2da:a813:a60c with SMTP id\n 5a478bee46e88-2e4786462fdmr17968606eec.20.1777063532355;\n Fri, 24 Apr 2026 13:45:32 -0700 (PDT)","by 2002:a05:7300:6413:b0:2da:a813:a60c with SMTP id\n 5a478bee46e88-2e4786462fdmr17968586eec.20.1777063531721;\n Fri, 24 Apr 2026 13:45:31 -0700 (PDT)"],"Content-Type":"multipart/mixed; boundary=\"------------jv7MMSLAFXv2exafTWuOn1w1\"","Message-ID":"<a533fcbd-de94-4444-856c-ad7ab93c4251@oss.qualcomm.com>","Date":"Fri, 24 Apr 2026 14:45:30 -0600","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Content-Language":"en-US","To":"'GCC Patches' <gcc-patches@gcc.gnu.org>","From":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>","Subject":"[to-be-committed][RISC-V][PR target/124984] Fix RTL checking abort in\n thead memory address classification","X-Authority-Analysis":"v=2.4 cv=cdDiaHDM c=1 sm=1 tr=0 ts=69ebd66d cx=c_pps\n a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=asGLMfRmzhnGNxaIYohjRg==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=r77TgQKjGQsHNAKrUKIA:9\n a=qYIfiMubUK46uB6Nco4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10\n a=zgiPjhLxNE0A:10 a=Fl24XjX0Ou921kynevsA:9 a=B2y7HmGcmWMA:10\n a=bBxd6f-gb0O0v-kibOvt:22","X-Proofpoint-GUID":"jc7KWwPNELU4Y9qxGVJXeXJomuD9pBu3","X-Proofpoint-ORIG-GUID":"jc7KWwPNELU4Y9qxGVJXeXJomuD9pBu3","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDI0MDIwMiBTYWx0ZWRfX5JRcY51GokwW\n R7Y50Rr1IEKGDoyALV+CB0CpKvxJvBDBa2zbU7xEreVZIb8mMaeLYiu8958Ju2SsLDtevhWgh+y\n T/PD6MnZ9mnW5S2cVCrSg3QvniP9IKPA6l6q/Dp/0GEjCVXAWOqGBgO+Dka9SWUuBZB9hE7fUPK\n 6T1Vrn6zlTXw/1ZXSgbzWl5y9Tsy4mPkcqs1IsLQspfHHgNQSo5L94ARN6rHyQubPBhHbRjH6Y7\n JuSJ6oRWyoHENbzgqhOp8L8ar+DrB3Vz4IfdP2yQL4REBFSRPEUy5UFku1Zwu6n11rPXxqdV+rC\n 3ensfmIQRPI7BOIoxPs6N+yDtzBSX0Tj5eMFjUnkrUcgkHygagw87XrYFUxc/XoMn7jkGkn1FhX\n cS8sHUTv4F1Tv9RbVjpAgW39naf9Q40n4n8u0MJoJNTPXdxEIikLqZL6YfK6bcgnGEUiBpsYtvU\n hmVuKVcXC4BDQ28dfww==","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-24_03,2026-04-21_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n clxscore=1015 malwarescore=0 spamscore=0 impostorscore=0 lowpriorityscore=0\n suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604240202","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":"As shown in the PR, we can trigger an RTL checking abort when \nclassifying thead specific addressing modes. As far as I can tell, the \ncode is supposed to be extracting constant value from the multiply \noperation, but instead is referencing the wrong object.\n\nThe fix is trivial.  I don't think this is anywhere near serious enough \nto try to get into the imminent gcc-16 release.  So after pre-commit \ntesting is done I'll push to the trunk, then backport in a week or so \nafter the gcc-16 release has been made.\n\nThis has been regression tested on riscv64-elf and riscv32-elf. While it \nwill spin on the Pioneer overnight, which has the relevant thead \nextensions, they aren't enabled by default, so I don't really expect any \nmeaningful improvements to coverage.\n\nJeff\nPR target/124984\ngcc/\n\t* config/riscv/thead.cc (th_memidx_classify_address_index): Extract\n\tconstant multiplicand value from the right object.\n\ngcc/testsuite\n\t* gcc.target/riscv/pr124984.c: New test.","diff":"diff --git a/gcc/config/riscv/thead.cc b/gcc/config/riscv/thead.cc\nindex f43bfdbb354..1f25af96e7f 100644\n--- a/gcc/config/riscv/thead.cc\n+++ b/gcc/config/riscv/thead.cc\n@@ -678,7 +678,7 @@ th_memidx_classify_address_index (struct riscv_address_info *info, rtx x,\n     {\n       type = (GET_CODE (XEXP (offset, 0)) == SIGN_EXTEND)\n \t     ? ADDRESS_REG_REG : ADDRESS_REG_UREG;\n-      shift = exact_log2 (INTVAL (XEXP (x, 1)));\n+      shift = exact_log2 (INTVAL (offset));\n       offset = XEXP (XEXP (x, 0), 0);\n     }\n   /* (ashift:X (reg:X) (const_int shift)) */\ndiff --git a/gcc/testsuite/gcc.target/riscv/pr124984.c b/gcc/testsuite/gcc.target/riscv/pr124984.c\nnew file mode 100644\nindex 00000000000..7d1124893b7\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/riscv/pr124984.c\n@@ -0,0 +1,10 @@\n+/* { dg-do compile { target bitint } } */\n+/* { dg-options \"-mcpu=thead-c906 -ftracer -fno-tree-dominator-opts -O2 -fharden-conditional-branches\" } */\n+\n+int g;\n+\n+void\n+foo(int s)\n+{\n+  g = 0x258d9b711584058072a68c6c9d0ff404fd077b87d59ee75dd2e349825d3a288c61a054e3aa1804c26adb2b9ce2287f17888af3aca18a430bcb4f334672553aecd010e5618a1293691bfd6f3e1d0d8ea3dbdb9176a53d1f657032263707cae4e5e70badc7769309b006495fbd3e76ca25f4d02df66107dc351e928wb >> (s & 1023);\n+}\n","prefixes":["to-be-committed","RISC-V","PR","target/124984"]}