From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 65E803858D20; Wed, 12 Jul 2023 02:23:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65E803858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689128621; bh=i8E0Ayi3Q4dKusCXXezOq5jjZQY2wrl0T4SeMCrPu50=; h=From:To:Subject:Date:In-Reply-To:References:From; b=s0o53z+jKj3iak2ojUbeRGEF5+13eXSGmWjhKDs1RtHu88gzUxY0TUIkL0SCmYl8L iXy+doHEVmdxz/iVMfkz5F3jPcLDsv3aFp5u0P+7FyMUwjHIalO+FIiB5fisFIkx68 iqYzuwPgfkdf35EDYOxgehSIQwL2zo9X3xYmE1PY= From: "syq at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/104914] [MIPS] wrong comparison with scrabbled int value Date: Wed, 12 Jul 2023 02:23:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: syq at gcc dot gnu.org X-Bugzilla-Status: NEW 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104914 --- Comment #13 from YunQiang Su --- This tiny patch works will this small test case by replace with dins to ins. I have no idea whether it will have any side effects. Any idea? diff --git a/gcc/expmed.cc b/gcc/expmed.cc index fbd4ce2d42f..37f90912122 100644 --- a/gcc/expmed.cc +++ b/gcc/expmed.cc @@ -849,7 +849,7 @@ store_bit_field_1 (rtx str_rtx, poly_uint64 bitsize, poly_uint64 bitnum, if we aren't. This must come after the entire register case above, since that case is valid for any mode. The following cases are only valid for integral modes. */ - opt_scalar_int_mode op0_mode =3D int_mode_for_mode (GET_MODE (op0)); + opt_scalar_int_mode op0_mode =3D int_mode_for_mode (GET_MODE (str_rtx)); scalar_int_mode imode; if (!op0_mode.exists (&imode) || imode !=3D GET_MODE (op0)) {=