https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91664

--- Comment #5 from element at elementsofsound dot org <element at 
elementsofsound dot org> ---
(In reply to Andrew Pinski from comment #3)
> Maybe it is not clear but target_clones is only supposed to be on the
> definition rather just declarations too.

I'm not sure if I understood you exactly. The target_clones attribute is
defined in the header file for the definition of the function (for use by other
.c files). If I add it to the actual function, GCC complains, so I only have it
on the definition. I think that is what you meant.

One thing I have noticed is that when the .c files are compiled as individual
object files, objdump shows that the number at the end of the symbols for the
target clones do not match. However, when linking these object files with gcc
they somehow are resolved. If instead they are placed in an archive, then they
don't resolve. Not sure if this is related. It seems like this has something to
do more with the linking than gcc compilation of the C code. So perhaps my lack
of knowledge led me to file the bug for the wrong component?

See below:
objdump -t fmv-test.o | grep fmv_test
0000000000000000 l     F .text  0000000000000062 fmv_test.default.9
0000000000000239 l     F .text  0000000000000062 fmv_test.avx2.4
000000000000029b l     F .text  0000000000000062 fmv_test.avx.5
00000000000002fd l     F .text  0000000000000062 fmv_test.sse4_1.6
000000000000035f l     F .text  0000000000000062 fmv_test.sse2.7
0000000000000000 l    d  .text.fmv_test.resolver    0000000000000000
.text.fmv_test.resolver
00000000000003c1 g   i   .text  0000000000000080
internal_func._GLOBAL___fmv_test.ifunc
0000000000000000  w    F .text.fmv_test.resolver    0000000000000080
fmv_test.resolver
0000000000000000 g   i   .text.fmv_test.resolver    0000000000000080 fmv_test

objdump -t main.o | grep fmv_test
0000000000000000 l    d  .text.fmv_test.resolver    0000000000000000
.text.fmv_test.resolver
0000000000000000 g   i   .text.fmv_test.resolver    0000000000000080 fmv_test
0000000000000000  w    F .text.fmv_test.resolver    0000000000000080
fmv_test.resolver
0000000000000000         *UND*  0000000000000000 fmv_test.avx2.0
0000000000000000         *UND*  0000000000000000 fmv_test.avx.1
0000000000000000         *UND*  0000000000000000 fmv_test.sse4_1.2
0000000000000000         *UND*  0000000000000000 fmv_test.sse2.3
0000000000000000         *UND*  0000000000000000 fmv_test.default.4

Reply via email to