https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78417
Bug ID: 78417 Summary: target_clones default for powerpc64 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tkoenig at gcc dot gnu.org Target Milestone: --- The following does not work as expected. Either default is an invalid target for target_clones, or it is missing. Bit of a Catch-22 there :-) The reason why I'm interested is PR 78379; I think PowerPC could also profit from processor-specific versions of matmul in the library. [tkoenig@gcc1-power7 ~]$ cat target.c static double foo_int(const double *restrict, const double *restrict, int) __attribute__ ((target_clones("cpu=power7,cpu=power8,default"))) ; double foo(const double *restrict a, const double *restrict b, int n) { return foo_int(a,b,n); } static double foo_int(const double *restrict a, const double *restrict b, int n) { double s; int i; s = 0.0; for (i=0; i<n; i++) s += a[i] * b[i]; return s; } [tkoenig@gcc1-power7 ~]$ gcc -S target.c target.c:19:1: error: __attribute__((__target__("default"))) is invalid } ^ target.c:10:15: error: attribute(target_clones("default")) is not valid for current target static double foo_int(const double *restrict a, const double *restrict b, int n) ^~~~~~~ [tkoenig@gcc1-power7 ~]$ cat t2.c static double foo_int(const double *restrict, const double *restrict, int) __attribute__ ((target_clones("cpu=power7,cpu=power8"))) ; double foo(const double *restrict a, const double *restrict b, int n) { return foo_int(a,b,n); } static double foo_int(const double *restrict a, const double *restrict b, int n) { double s; int i; s = 0.0; for (i=0; i<n; i++) s += a[i] * b[i]; return s; } [tkoenig@gcc1-power7 ~]$ gcc -S t2.c t2.c:10:15: error: default target was not set static double foo_int(const double *restrict a, const double *restrict b, int n) ^~~~~~~ [tkoenig@gcc1-power7 ~]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/tkoenig/libexec/gcc/powerpc64-unknown-linux-gnu/7.0.0/lto-wrapper Target: powerpc64-unknown-linux-gnu Configured with: ../trunk/configure --prefix=/home/tkoenig --enable-languages=c,c++,fortran Thread model: posix gcc version 7.0.0 20161116 (experimental) (GCC)