From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D05F3858C74; Thu, 11 Aug 2022 18:47:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D05F3858C74 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106586] riscv32 still broke with zba_zbb_zbc_zbs, ICE in do_SUBST in C++ code Date: Thu, 11 Aug 2022 18:47:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2022 18:47:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106586 --- Comment #4 from Andrew Pinski --- diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 5a0adffb5ce..b4a08de6b93 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -426,7 +426,9 @@ riscv_build_integer_1 (struct riscv_integer_op codes[RISCV_MAX_INTEGER_OPS], sign-extended (negative) representation (-1 << 31) for the value, if we want to build (1 << 31) in SImode. This will then expand to an LUI instruction. */ - if (mode =3D=3D SImode && value =3D=3D (HOST_WIDE_INT_1U << 31)) + if (TARGET_64BIT + && mode =3D=3D SImode + && value =3D=3D (HOST_WIDE_INT_1U << 31)) codes[0].value =3D (HOST_WIDE_INT_M1U << 31); return 1; Fixes that ICE but there is still another ICE with the same reduced testcas= e: 0xd9898c wi::int_traits >::decompose(long= *, unsigned int, std::pair const&) ../../src/gcc/rtl.h:2288 0x1136bf7 wide_int_ref_storage::wide_int_ref_storage >(std::pair const&, unsigned int) ../../src/gcc/wide-int.h:1034 0x1136bf7 generic_wide_int >::generic_wide_int >(std::pair const&, unsigned int) ../../src/gcc/wide-int.h:790 0x1136bf7 wi::binary_traits, std::pair, wi::int_traits >::precision_type, wi::int_traits >::precision_type>::result_type wi::add, std::pair >(std::pair const&, std::pair const&) ../../src/gcc/wide-int.h:2442 0x1136bf7 simplify_const_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*) ../../src/gcc/simplify-rtx.cc:5004 0x113de58 simplify_context::simplify_binary_operation(rtx_code, machine_mod= e, rtx_def*, rtx_def*) ../../src/gcc/simplify-rtx.cc:2569 0x10d1b75 simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_d= ef*) ../../src/gcc/rtl.h:3475 0x10d1b75 simplify_while_replacing ../../src/gcc/recog.cc:686 0x10d1b75 validate_replace_rtx_1 ../../src/gcc/recog.cc:890 0x10fefb4 note_uses(rtx_def**, void (*)(rtx_def**, void*), void*) ../../src/gcc/rtlanal.cc:2065 0x10cd9b2 validate_replace_src_group(rtx_def*, rtx_def*, rtx_insn*) ../../src/gcc/recog.cc:979 0x1945e30 try_replace_reg ../../src/gcc/cprop.cc:752 0x1946509 constprop_register ../../src/gcc/cprop.cc:1023 0x194688b do_local_cprop ../../src/gcc/cprop.cc:1208 0x194688b local_cprop_pass ../../src/gcc/cprop.cc:1271 0x194688b one_cprop_pass ../../src/gcc/cprop.cc:1772 0x194688b execute_rtl_cprop ../../src/gcc/cprop.cc:1926 0x194688b execute ../../src/gcc/cprop.cc:1966 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Still debugging this.=