From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 32AD2388E815; Mon, 13 Jul 2020 17:34:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32AD2388E815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594661684; bh=aUSBT8ZKoI4FEnjR//C1IbhRLgDgBvm1DqctPkH6MaE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WalF6ZAeMnSeRfrrjdlUkK3clBfcnjWIRhn/3RBCrV9W8kTRXFPGCF/Buw2Ni/XxG l1OKVetVF3D295zSlmp4ylH+7XPZiYWeuRTfSUyngf6whuK80TN6PoKfte+b3Q4QZF VqXixiS+G0cDl/cD/QBMtBzzrKShuS6cmvMlvzNw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95443] cmpstrnqi patterns update string length Date: Mon, 13 Jul 2020 17:34:44 +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: wrong-code 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 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, 13 Jul 2020 17:34:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95443 --- Comment #1 from CVS Commits --- The master branch has been updated by H.J. Lu : https://gcc.gnu.org/g:9cba898481368ce16c6a2d30ef781a82dce27c55 commit r11-2068-g9cba898481368ce16c6a2d30ef781a82dce27c55 Author: H.J. Lu Date: Mon Jul 13 10:33:47 2020 -0700 x86: Pass a copy of the string length to cmpstrnqi cmpstrnsi expander may pass the actual string length directly to cmpstr= nqi patterns. For cmpstrnsi, one of the strings must be a constant and expand_builtin_strncmp rewrites the length argument to be the minimum of the const string length and the actual string length. But it is not the case for cmpmemsi. Pass a copy of the string length to cmpstrnqi patte= rns to avoid changing the actual string length by cmpstrnqi patterns. gcc/ PR target/95443 * config/i386/i386.md (cmpstrnsi): Pass a copy of the string length to cmpstrnqi patterns. gcc/testsuite/ PR target/95443 * gcc.target/i386/pr95443-1.c: New test. * gcc.target/i386/pr95443-2.c: Likewise.=