[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2021-09-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |8.5

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2021-04-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

--- Comment #13 from Jakub Jelinek  ---
Fixed.

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2021-04-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #12 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:ebb474647037a7bd429e400b21b2dedbb78fee5e

commit r8-10858-gebb474647037a7bd429e400b21b2dedbb78fee5e
Author: Jakub Jelinek 
Date:   Sat Sep 26 10:07:41 2020 +0200

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  

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

(cherry picked from commit cd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b)

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2021-04-20 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #11 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:c60d0f6b7b586ff623e423c28f403ab7e5e78fbc

commit r9-9388-gc60d0f6b7b586ff623e423c28f403ab7e5e78fbc
Author: Jakub Jelinek 
Date:   Sat Sep 26 10:07:41 2020 +0200

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  

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

(cherry picked from commit cd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b)

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2021-04-16 Thread pkubaj at anongoth dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #10 from Piotr Kubaj  ---
Would it be possible to backport this issue to 9?

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-10-05 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #9 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:cd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b

commit r10-8851-gcd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b
Author: Jakub Jelinek 
Date:   Sat Sep 26 10:07:41 2020 +0200

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  

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

(cherry picked from commit d00b1b023ecfc3ddc3fe952c0063dab7529d5f7a)

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-26 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:d00b1b023ecfc3ddc3fe952c0063dab7529d5f7a

commit r11-3476-gd00b1b023ecfc3ddc3fe952c0063dab7529d5f7a
Author: Jakub Jelinek 
Date:   Sat Sep 26 10:07:41 2020 +0200

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  

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

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #7 from Segher Boessenkool  ---
Ah.

Is there no better way to detect GCC impostors?  Oh well.

Since we require 4.5 as bootstrap compiler, this makes no difference
at all for compilers that truthfully claim to be GCC, so it has my
blessing if you want that :-)

Thanks!

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #6 from Jakub Jelinek  ---
It can be anything > 4.2 (because clang pretends to be GCC 4.2).

4.5 was just because the other altivec section was >= 4.5.
PR45381 contains some details about that.

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #5 from Segher Boessenkool  ---
Yeah, good point.

So either we can convert to the normal intrinsics, or (much easier)
check we are building with GCC at all.  But why 4.5?  Do earlier
versions not work?

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #4 from Jakub Jelinek  ---
Well, libcpp isn't using the standard Altivec intrinsics, but their gcc
underlying implementation.  Looking at clang altivec.h, I see they use vector
keyword everywhere and not sure what exactly they map it to under the hood, but
clearly not to altivec attribute, and they have different __builtin_* calls to
implement e.g. vsx_ld and the like.

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

--- Comment #3 from Segher Boessenkool  ---
(In reply to Jakub Jelinek from comment #2)
> Guess we need something like:
> -#elif defined(_ARCH_PWR8) && defined(__ALTIVEC__)
> +#elif (GCC_VERSION >= 4005) && defined(_ARCH_PWR8) && defined(__ALTIVEC__)
> in libcpp/lex.c if clang doesn't support the altivec attribute and the
> builtins.

But it should!  What is actually going wrong here?  The compiler should
not declare it supports what is tested for by __ALTIVEC__ if it doesn't.

[Bug bootstrap/97163] Build error with -mcpu=power9 on ppc64

2020-09-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97163

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||segher at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Guess we need something like:
-#elif defined(_ARCH_PWR8) && defined(__ALTIVEC__)
+#elif (GCC_VERSION >= 4005) && defined(_ARCH_PWR8) && defined(__ALTIVEC__)
in libcpp/lex.c if clang doesn't support the altivec attribute and the
builtins.