From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FCEC3857404; Mon, 19 Jul 2021 07:43:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FCEC3857404 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100204] aarch64: UB evaluating J constraint Date: Mon, 19 Jul 2021 07:43:43 +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: 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: Mon, 19 Jul 2021 07:43:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100204 --- Comment #1 from Andrew Pinski --- (define_constraint "J" "A constant that can be used with a SUB operation (once negated)." (and (match_code "const_int") (match_test "aarch64_uimm12_shift (-ival)"))) So this should be: - (unsigned HOST_WIDE_INT) ival There are other targets which have a similar issue: config/alpha/constraints.md: (match_test "IN_RANGE (-ival, 0, 255)"))) config/arc/constraints.md: (match_test "UNSIGNED_INT6 (-ival)"))) config/arc/constraints.md: && ((ival >=3D 0 ? ival : -= ival) config/arc/constraints.md: <=3D 0x3f * (ival & -ival)))"))) config/arc/constraints.md: (match_test "!(ival & ~124) || !(-ival & ~124)"))) config/arc/constraints.md: && ((ival >=3D 0 ? ival : -= ival) config/arc/constraints.md: <=3D 0x7ff * (ival & -ival)))"))) config/arc/constraints.md: (match_test "IS_POWEROF2_P (-ival)") config/arc/constraints.md: (match_test "IS_POWEROF2_OR_0_P (ival + (i= val & -ival))"))) config/arc/constraints.md: || ((ival & 0xffffffffUL) >> exact_log2 (ival & -ival) config/arm/constraints.md: (match_test "((-ival) & 0xfffff000) =3D= =3D 0")))) config/arm/constraints.md: (match_test "TARGET_32BIT ? const_ok_for_arm (-ival) config/csky/constraints.md: (match_test "CSKY_CONST_OK_FOR_Uj (-ival + 4)"))) config/epiphany/constraints.md: (match_test "SIMM11 (-ival)"))) config/pru/constraints.md: (match_test "UBYTE_INT (-ival)")))=