{"id":2225510,"url":"http://patchwork.ozlabs.org/api/patches/2225510/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/aecS8FwuBYDduaOJ@tucnak/","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":"<aecS8FwuBYDduaOJ@tucnak>","list_archive_url":null,"date":"2026-04-21T06:02:24","name":"sccvn: Use build_bitint_type in another SCCVN spot [PR124941]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"35f96e22a822dbaabc0644e20484896500d11a1c","submitter":{"id":671,"url":"http://patchwork.ozlabs.org/api/people/671/?format=json","name":"Jakub Jelinek","email":"jakub@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/aecS8FwuBYDduaOJ@tucnak/mbox/","series":[{"id":500735,"url":"http://patchwork.ozlabs.org/api/series/500735/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=500735","date":"2026-04-21T06:02:24","name":"sccvn: Use build_bitint_type in another SCCVN spot [PR124941]","version":1,"mbox":"http://patchwork.ozlabs.org/series/500735/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2225510/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2225510/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=PnKh/pks;\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=PnKh/pks","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 4g0Bbr5LRmz1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 16:03:03 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E1C114BA2E3F\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 06:03:00 +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 62B004BA2E25\n for <gcc-patches@gcc.gnu.org>; Tue, 21 Apr 2026 06:02:31 +0000 (GMT)","from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-80-MBDNjWzYPaKVyEneBCb3mA-1; Tue,\n 21 Apr 2026 02:02:29 -0400","from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 54A6619560B8; Tue, 21 Apr 2026 06:02:28 +0000 (UTC)","from tucnak.zalov.cz (unknown [10.44.48.12])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id BF8B4180047F; Tue, 21 Apr 2026 06:02:27 +0000 (UTC)","from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63L62O7g886092\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Tue, 21 Apr 2026 08:02:24 +0200","(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63L62O3x886091;\n Tue, 21 Apr 2026 08:02:24 +0200"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E1C114BA2E3F","OpenDKIM Filter v2.11.0 sourceware.org 62B004BA2E25"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 62B004BA2E25","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 62B004BA2E25","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776751351; cv=none;\n b=rXgXtYu4c7Ee5VslA+Snm+QqyrPVBbcgMFMYVdvly1RieCeaPG+ASLEryyovJIzXeNxkpZFR2NlJS+uN8L4V4nJytMbWtuk+3UULlrqhB8GU69i9VISpEfYkLsRzSYU2ldwZ40TscfxkQRPl314L1y4FYDDJxcaJd2ijOdnzi/4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776751351; c=relaxed/simple;\n bh=q97uC+gnIjLfZruwTyySa1M3kTEhROpAWJUmVXAcUmA=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=dnymc70/8ANIP+rUg4t0lQKv3L79AZo4wDaA7M0elVY/bL6VmTlW4egfeSSEe6cXXjbPvqxbiLErBbqM7mqGEJJ8hZGDG05ys/kpLbvynV1SOKZFbULxpxAE9PleQn3+xLNGMyYFTq3TdWe3scAhN/kZ7IfpvCmGpaisfGy2EG4=","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=1776751350;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=RVx+z+TzYylz4ezjzhGIazolCgu+u0q+i/SaorjSohY=;\n b=PnKh/pksZ84+HCkQGsCnH3xi+vW80oRoQoV9lxZ94nXyppBFaSF7GeNV8RS9qXRQ1BSrQZ\n lScz44LFaar3VeR+fiOa4m22Z40ZEIuCniDiXdqBqxfpDQ2LStafl4ktyN909MxIptotSo\n WT1tczdB594MhjjYS9DbEkomjaau2Tg=","X-MC-Unique":"MBDNjWzYPaKVyEneBCb3mA-1","X-Mimecast-MFC-AGG-ID":"MBDNjWzYPaKVyEneBCb3mA_1776751348","Date":"Tue, 21 Apr 2026 08:02:24 +0200","From":"Jakub Jelinek <jakub@redhat.com>","To":"Richard Biener <rguenther@suse.de>,\n Andrew Pinski <andrew.pinski@oss.qualcomm.com>","Cc":"gcc-patches@gcc.gnu.org","Subject":"[PATCH] sccvn: Use build_bitint_type in another SCCVN spot [PR124941]","Message-ID":"<aecS8FwuBYDduaOJ@tucnak>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.93","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"NM0p828yPbjP-Lx5hFQr0bKDKCJL42ERzp3qbwTalMo_1776751348","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","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>","Reply-To":"Jakub Jelinek <jakub@redhat.com>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Hi!\n\nThe following testcase ICEs on riscv.\ntree-ssa-sccvn.cc (vn_walk_cb_data::push_partial_def) already uses\nbuild_bitint_type instead of build_nonstandard_integer_type for larger\nBITINT_TYPE types:\n  /* Make sure to interpret in a type that has a range covering the whole\n     access size.  */\n  if (INTEGRAL_TYPE_P (vr->type) && maxsizei != TYPE_PRECISION (vr->type))\n    {\n      if (TREE_CODE (vr->type) == BITINT_TYPE\n          && maxsizei > MAX_FIXED_MODE_SIZE)\n        type = build_bitint_type (maxsizei, TYPE_UNSIGNED (type));\n      else\n        type = build_nonstandard_integer_type (maxsizei, TYPE_UNSIGNED (type));\n    }\nand the same change in vn_reference_lookup_3 fixes the ICE.\n\nBootstrapped/regtested on x86_64-linux and i686-linux and x86_64-linux ->\nriscv64-linux cross compiler tested on the testcase, ok for trunk?\n\n2026-04-21  Jakub Jelinek  <jakub@redhat.com>\n\n\tPR tree-optimization/124941\n\t* tree-ssa-sccvn.cc (vn_reference_lookup_3): Use build_bitint_type\n\trather than build_nonstandard_integer_type for\n\tmaxsizei larger than MAX_FIXED_MODE_SIZE.\n\n\t* gcc.dg/bitint-129.c: New test.\n\n\n\tJakub","diff":"--- gcc/tree-ssa-sccvn.cc.jj\t2026-03-27 10:17:21.501210523 +0100\n+++ gcc/tree-ssa-sccvn.cc\t2026-04-20 12:40:15.175842096 +0200\n@@ -3284,8 +3284,14 @@ vn_reference_lookup_3 (ao_ref *ref, tree\n \t\t     covering the whole access size.  */\n \t\t  if (INTEGRAL_TYPE_P (vr->type)\n \t\t      && maxsizei != TYPE_PRECISION (vr->type))\n-\t\t    type = build_nonstandard_integer_type (maxsizei,\n-\t\t\t\t\t\t\t   TYPE_UNSIGNED (type));\n+\t\t    {\n+\t\t      bool uns = TYPE_UNSIGNED (type);\n+\t\t      if (TREE_CODE (vr->type) == BITINT_TYPE\n+\t\t\t  && maxsizei > MAX_FIXED_MODE_SIZE)\n+\t\t\ttype = build_bitint_type (maxsizei, uns);\n+\t\t      else\n+\t\t\ttype = build_nonstandard_integer_type (maxsizei, uns);\n+\t\t    }\n \t\t  if (BYTES_BIG_ENDIAN)\n \t\t    {\n \t\t      /* For big-endian native_encode_expr stored the rhs\n--- gcc/testsuite/gcc.dg/bitint-129.c.jj\t2026-04-20 12:43:29.585546318 +0200\n+++ gcc/testsuite/gcc.dg/bitint-129.c\t2026-04-20 12:42:46.331279596 +0200\n@@ -0,0 +1,14 @@\n+/* PR tree-optimization/124941 */\n+/* { dg-do compile { target bitint } } */\n+/* { dg-options \"-O2 -fno-strict-aliasing\" } */\n+\n+#if __BITINT_MAXWIDTH__ >= 1024\n+_BitInt(257)\n+foo ()\n+{\n+  _BitInt(1024) b = 0;\n+  return *(_BitInt(257) *)&b;\n+}\n+#else\n+int i;\n+#endif\n","prefixes":[]}