This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] tilegx: work around vector insn bug in gcc
- From: Chris Metcalf <cmetcalf at mellanox dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Tue, 5 Dec 2017 11:25:01 -0500
- Subject: Re: [PATCH] tilegx: work around vector insn bug in gcc
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=cmetcalf at mellanox dot com;
- References: <firstname.lastname@example.org> <email@example.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 12/5/2017 11:12 AM, Adhemerval Zanella wrote:
On 04/12/2017 13:56, Chris Metcalf wrote:
Avoid an issue in gcc where some of the vector (aka SIMD) ops will
sometimes end up getting wrongly optimized out. We use these
instructions in many of the string implementations. If/when we
have an upstreamed fix for this problem in gcc we can conditionalize
the use of the extended assembly workaround in glibc.
Do you the conditions to trigger this issue (compiler option, gcc
Embarrassingly, as far as I know this bug has always been present at
optimization levels above -O0. Basically, if the output of a vector op
is passed through another math operation, there is some architecture
independent phase that ends up optimizing out the vector op.
I always did my native build testing on one of our TILE-Gx machines
that was already provisioned with compiler, build tools, etc, with
gcc 4.8 pre-installed. This compiler had the bug fix so my tests always
I also did full upstream-only build testing, bootstrapping gcc/glibc,
etc., to make sure that that flow was correct as well - but I always did
it as a cross-build flow and didn't do runtime testing of the generated
binaries, or I would have seen this issue earlier.
It was only when glibc switched to requiring a compiler newer than
4.8 that I tried to do my native build testing using an upstream compiler
version. The folks who were responsible here at Mellanox for ongoing
maintenance of the tilegx compiler have been too busy to tackle the
issue since then, which is why I finally worked around it the way I did.
Chris Metcalf, Mellanox Technologies