This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] tilegx: work around vector insn bug in gcc
- From: Henrik Grindal Bakken <hgb at ifi dot uio dot no>
- To: libc-alpha at sourceware dot org
- Date: Fri, 05 Jan 2018 10:15:12 +0100
- Subject: Re: [PATCH] tilegx: work around vector insn bug in gcc
- Authentication-results: sourceware.org; auth=none
- References: <1512403009-12871-1-git-send-email-cmetcalf@mellanox.com> <87bdd200-6783-d8a3-30a8-bf0df69eb3b1@linaro.org> <alpine.DEB.2.20.1712051622090.14928@digraph.polyomino.org.uk> <d3b95fc0-63c5-633c-893f-cab5e0da2440@mellanox.com>
Chris Metcalf <cmetcalf@mellanox.com> 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 <henribak@cisco.com>
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)))
--
Henrik Grindal Bakken <hgb@ifi.uio.no>
PGP ID: 8D436E52
Fingerprint: 131D 9590 F0CF 47EF 7963 02AF 9236 D25A 8D43 6E52