From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC145382E82F; Sat, 27 Feb 2021 09:02:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC145382E82F From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/93353] ICE: in final_scan_insn_1, at final.c:3073 (error: could not split insn) Date: Sat, 27 Feb 2021 09:02:17 +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: 10.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: Sat, 27 Feb 2021 09:02:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93353 --- Comment #7 from Jakub Jelinek --- And to explain what was happening, rs6000_legitimize_address has been called on x (plus:SI (reg/f:SI 117) (const_int 2147483647 [0x7fffffff])) and mode QImode, oldx =3D=3D x. ((0x7fffffff & 0xffff) ^ 0x8000) - 0x8000 is low_int -1 and if (low_int >=3D 0x8000 - extra) is not true and 0x7fffffff - -1 is 0x80000000 (with UB on the compiler side= ). So maybe the above mentioned commit wasn't sufficient and we should - high_int =3D INTVAL (XEXP (x, 1)) - low_int; + high_int =3D UINTVAL (XEXP (x, 1)) - low_int; But also && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) + 0x8000) can invoke UB in the compiler, shouldn't it be just && ((UINTVAL (XEXP (x, 1)) + 0x8000) ?=