]> git.ipfire.org Git - thirdparty/gcc.git/commit
powerpc, libcpp: Fix gcc build with clang on power8 [PR97163]
authorJakub Jelinek <jakub@redhat.com>
Sat, 26 Sep 2020 08:07:41 +0000 (10:07 +0200)
committerJakub Jelinek <jakub@redhat.com>
Mon, 5 Oct 2020 08:23:04 +0000 (10:23 +0200)
commitcd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b
treeb1fb948b268168aeadb5be118247c98e8eb8be28
parent3f56563cf84f97ef271ef0f949a571c13cdd06e2
powerpc, libcpp: Fix gcc build with clang on power8 [PR97163]

libcpp has two specialized altivec implementations of search_line_fast,
one for power8+ and the other one otherwise.
Both use __attribute__((altivec(vector))) and the GCC builtins rather than
altivec.h and the APIs from there, which is fine, but should be restricted
to when libcpp is built with GCC, so that it can be relied on.
The second elif is
and thus e.g. when built with clang it isn't picked, but the first one was
just guarded with
and so according to the bugreporter clang fails miserably on that.

The following patch fixes that by adding the same GCC_VERSION requirement
as the second version.  I don't know where the 4.5 in there comes from and
the exact version doesn't matter that much, as long as it is above 4.2 that
clang pretends to be and smaller or equal to 4.8 as the oldest gcc we
support as bootstrap compiler ATM.
Furthermore, the patch fixes the comment, the version it is talking about is
not pre-GCC 5, but actually the GCC 5+ one.

2020-09-26  Jakub Jelinek  <jakub@redhat.com>

PR bootstrap/97163
* lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
for GCC >= 4.5.

(cherry picked from commit d00b1b023ecfc3ddc3fe952c0063dab7529d5f7a)
libcpp/lex.c