From patchwork Fri Jan 5 09:15:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Grindal Bakken X-Patchwork-Id: 25224 Received: (qmail 36707 invoked by alias); 5 Jan 2018 09:15:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 36693 invoked by uid 89); 5 Jan 2018 09:15:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=H*r:Unknown, H*Ad:D*no, day X-HELO: blaine.gmane.org To: libc-alpha@sourceware.org From: Henrik Grindal Bakken Subject: Re: [PATCH] tilegx: work around vector insn bug in gcc Date: Fri, 05 Jan 2018 10:15:12 +0100 Lines: 61 Message-ID: References: <1512403009-12871-1-git-send-email-cmetcalf@mellanox.com> <87bdd200-6783-d8a3-30a8-bf0df69eb3b1@linaro.org> Mime-Version: 1.0 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Chris Metcalf writes: > Good point. A bug was filed for this a year ago (78117) and I added a > comment with my small use case, and pushed a tweak to the comment in > sysdeps/tile/tilegx/string-endian.h referencing the bug. That bug was filed by me, and is seemingly still open. I got a patch back in the day from Mellanox which solved the problem for us. I thought that bug was upstreamed to gcc, but apparently not. The patch is attached. commit 2486eee210176ac9bfd2e4bfcb4b18c32245d457 Author: Henrik Grindal Bakken Date: Tue Nov 22 16:36:34 2016 +0100 combine: Patch from Mellanox for tilegx optimization bug This bug manifests itself by making strstr() fail its tests. This fix is from Mellanox. diff --git a/gcc/combine.c b/gcc/combine.c index 75c6229..2ee30f1 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7213,6 +7213,7 @@ expand_field_assignment (const_rtx x) else if (GET_CODE (SET_DEST (x)) == SUBREG /* We need SUBREGs to compute nonzero_bits properly. */ && nonzero_sign_valid + && !VECTOR_MODE_P (GET_MODE (SET_DEST (x))) && (((GET_MODE_SIZE (GET_MODE (SET_DEST (x))) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (SET_DEST (x)))) @@ -12790,6 +12791,7 @@ record_dead_and_set_regs_1 (rtx dest, const_rtx setter, void *data) record_value_for_reg (dest, record_dead_insn, SET_SRC (setter)); else if (GET_CODE (setter) == SET && GET_CODE (SET_DEST (setter)) == SUBREG + && !VECTOR_MODE_P (GET_MODE (SET_DEST (setter))) && SUBREG_REG (SET_DEST (setter)) == dest && GET_MODE_PRECISION (GET_MODE (dest)) <= BITS_PER_WORD && subreg_lowpart_p (SET_DEST (setter)))