llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.97k stars 11.94k forks source link

POWER8 and "error: unknown type name 'inline'" when using -std=c89 #45916

Open 70311826-e6d8-4d29-8604-c4ec4bfa7f0d opened 4 years ago

70311826-e6d8-4d29-8604-c4ec4bfa7f0d commented 4 years ago
Bugzilla Link 46571
Version 8.0
OS Linux
CC @DougGregor,@noloader,@zygoloid

Extended Description

I'm working with a project that wishes to use -std=c89 -pedantic for testing.[1]

Compiling a POWER8 source file that uses vector built-ins [2], such as vec_ld, results in the following. It looks like Clang disagrees with 'inline' from .

I don't have a reproducer at the moment. The only POWER8 machine I have access to with Clang 8.0 is at Travis. The GCC compile farm has old versions of Clang, and I am getting different compile errors.

From [2]:

clang-8 blake2sp.c blake2s.c -o blake2sp -O3 -I../testvectors -Wall -Wextra -std=c89 -pedantic -Wno-long-long -mcpu=power8 -DBLAKE2SP_SELFTEST

In file included from blake2b.c:21:

In file included from ./blake2-impl.h:35:

/usr/lib/llvm-8/lib/clang/8.0.0/include/altivec.h:16173:8: error: unknown type name 'inline'

static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {

   ^

/usr/lib/llvm-8/lib/clang/8.0.0/include/altivec.h:16173:15: error: expected identifier or '('

static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {

          ^

/usr/lib/llvm-8/lib/clang/8.0.0/include/altivec.h:56:22: note: expanded from macro '__ATTRS_o_ai'

define ATTRS_o_ai attribute((overloadable, always_inline__))

                 ^

...

[1] https://travis-ci.org/github/noloader/BLAKE2/jobs/704535813 [2] https://github.com/BLAKE2/BLAKE2/blob/master/power8/blake2b.c

llvmbot commented 4 months ago

@llvm/issue-subscribers-backend-powerpc

Author: None (70311826-e6d8-4d29-8604-c4ec4bfa7f0d)

| | | | --- | --- | | Bugzilla Link | [46571](https://llvm.org/bz46571) | | Version | 8.0 | | OS | Linux | | CC | @DougGregor,@noloader,@zygoloid | ## Extended Description I'm working with a project that wishes to use -std=c89 -pedantic for testing.[1] Compiling a POWER8 source file that uses vector built-ins [2], such as vec_ld, results in the following. It looks like Clang disagrees with 'inline' from <altivec.h>. I don't have a reproducer at the moment. The only POWER8 machine I have access to with Clang 8.0 is at Travis. The GCC compile farm has old versions of Clang, and I am getting different compile errors. From [2]: clang-8 blake2sp.c blake2s.c -o blake2sp -O3 -I../testvectors -Wall -Wextra -std=c89 -pedantic -Wno-long-long -mcpu=power8 -DBLAKE2SP_SELFTEST In file included from blake2b.c:21: In file included from ./blake2-impl.h:35: /usr/lib/llvm-8/lib/clang/8.0.0/include/altivec.h:16173:8: error: unknown type name 'inline' static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) { ^ /usr/lib/llvm-8/lib/clang/8.0.0/include/altivec.h:16173:15: error: expected identifier or '(' static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) { ^ /usr/lib/llvm-8/lib/clang/8.0.0/include/altivec.h:56:22: note: expanded from macro '__ATTRS_o_ai' #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__)) ^ ... [1] https://travis-ci.org/github/noloader/BLAKE2/jobs/704535813 [2] https://github.com/BLAKE2/BLAKE2/blob/master/power8/blake2b.c