From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5977F3858D38; Mon, 6 May 2024 04:10:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5977F3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714968651; bh=pA6J2wPkYp91VSGLMQlNw4krZpccIscHolrqd6ZOU6I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xossq8SmZphkv32y2iX+/n1qiSV79GyPguoUMjGx91AD4cRSjT9FuciB6lnmpiQW4 v3BxOZ01O1WAPN2cE0TA4VY6qhjNmNjXudSCzwb7FC7/CF4GwO8aXASuyIacxz82NF vy3LiGkRkaTbgf/yit8mwBho3xXkNi0DGt+VV/go= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113179] [11/12/13/14/15 Regression] MIPS: INS is used for long long, before SLL Date: Mon, 06 May 2024 04:10:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 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=3D113179 --- Comment #4 from GCC Commits --- The master branch has been updated by YunQiang Su : https://gcc.gnu.org/g:7d5d2b879ae7636ca118fb4f3a08b22705cdeacb commit r15-171-g7d5d2b879ae7636ca118fb4f3a08b22705cdeacb Author: YunQiang Su Date: Mon Apr 29 00:33:44 2024 +0800 expmed: TRUNCATE value1 if needed in store_bit_field_using_insv PR target/113179. In `store_bit_field_using_insv`, we just use SUBREG if value_mode >=3D op_mode, while in some ports, a sign_extend will be needed, such as MIPS64: If either GPR rs or GPR rt does not contain sign-extended 32-bit values (bits 63..31 equal), then the result of the operation is UNPREDICTABLE. The problem happens for the code like: struct xx { int a:4; int b:24; int c:3; int d:1; }; void xx (struct xx *a, long long b) { a->d =3D b; } In the above code, the hard register contains `b`, may be note well sign-extended. gcc/ PR target/113179 * expmed.cc(store_bit_field_using_insv): TRUNCATE value1 if needed. gcc/testsuite PR target/113179 * gcc.target/mips/pr113179.c: New tests.=