From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E39CE3858439; Thu, 25 Jan 2024 19:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E39CE3858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706212686; bh=cIOK4Ml8PUU9XELcRSk0UKywJvpKoRqr9t5z6ZAcb84=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M18fiA8ovDXiG2RRMAHL+mr1On7VVQoWDaMssN2auA4Nsq/+m2duiwvDcgxNOq6Oc jiGwjquP8YbPDx5r8mOJjzc+erlvK+oQnc65e+ZQTVyUp5h3zhoL7gum9Off6bkA7z 6wDTX1LRodRhSPzdbJaIVuMFMNU9ifTlja6yM+yE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100204] aarch64: UB evaluating J constraint Date: Thu, 25 Jan 2024 19:58:03 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D100204 --- Comment #3 from GCC Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:f03b8f595b6350732bb0a9a69557c5ed2af085b2 commit r14-8436-gf03b8f595b6350732bb0a9a69557c5ed2af085b2 Author: Andrew Pinski Date: Thu Jan 25 08:30:36 2024 -0800 aarch64: Fix undefinedness while testing the J constraint [PR100204] The J constraint can invoke undefined behavior due to it taking the negative of the ival if ival was HWI_MIN. The fix is simple as casting to `unsigned HOST_WIDE_INT` before doing the negative of it. This does that. Committed as obvious after build/test for aarch64-linux-gnu. gcc/ChangeLog: PR target/100204 * config/aarch64/constraints.md (J): Cast to `unsigned HOST_WIDE_INT` before taking the negative of it. Signed-off-by: Andrew Pinski =