From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 541BE3858C2C; Tue, 14 Feb 2023 22:47:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 541BE3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676414827; bh=dRt/eDj739IvPJAb1+fTx5pNuJJbI6gbAkIqkczw0uM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qBNhIwY/DhFJvi7nxUiUNuA5am99UJ8T098BKnzS/NEnzIo6B6kZhhL921hjPNGLE ODIFknC/3UsblmoJaZ53ZAsMUS+IrHL1PhwDo4ZFH48aflwgyzLuAGNETLlevi5j/I OMkfLuHQpYP3LPiGdbLsBy491AE3a7eDbVFvFFVQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108790] bpf: gcc emits malformed ldxdw instruction at -O2 Date: Tue, 14 Feb 2023 22:47:07 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108790 --- Comment #1 from CVS Commits --- The master branch has been updated by David Faust : https://gcc.gnu.org/g:c348a717213b03c6661878934f197f4d261f0e56 commit r13-5989-gc348a717213b03c6661878934f197f4d261f0e56 Author: David Faust Date: Tue Feb 14 11:23:01 2023 -0800 bpf: fix memory constraint of ldx/stx instructions [PR108790] In some cases where the target memory address for an ldx or stx instruction could be reduced to a constant, GCC could emit a malformed instruction like: ldxdw %r0,0 Rather than the expected form: ldxdw %rX, [%rY + OFFSET] This is due to the constraint allowing a const_int operand, which the output templates do not handle. Fix it by introducing a new memory constraint for the appropriate operands of these instructions, which is identical to 'm' except that it does not accept const_int. gcc/ PR target/108790 * config/bpf/constraints.md (q): New memory constraint. * config/bpf/bpf.md (zero_extendhidi2): Use it here. (zero_extendqidi2): Likewise. (zero_extendsidi2): Likewise. (*mov): Likewise. gcc/testsuite/ PR target/108790 * gcc.target/bpf/ldxdw.c: New test.=