https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81276
Hannes Hauswedell <h2+bugs at fsfe dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |h2+bugs at fsfe dot org --- Comment #2 from Hannes Hauswedell <h2+bugs at fsfe dot org> --- target_clones does however work with templates: https://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,source:'%23include+%3Ccstdint%3E%0A%0Atemplate+%3Ctypename+int_t%3E%0A__attribute__((target_clones(%22default%22,+%22popcnt%22)))%0Auint64_t+pc(int_t+const+v)%0A%7B%0A++++return+__builtin_popcountll(v)%3B%0A%7D%0A%0Aint+main()%0A%7B%0A++++for+(uint64_t+i+%3D+0%3B+i+%3C+1!'000!'000!'000%3B+%2B%2Bi)%0A++++++++volatile+uint64_t+ret+%3D+pc(i)%3B%0A%7D'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:g72,filters:(b:'0',binary:'1',commentOnly:'0',demangle:'0',directives:'0',execute:'1',intel:'0',trim:'0'),libs:!(),options:'-O3+-DNDEBUG',source:1),l:'5',n:'0',o:'x86-64+gcc+7.2+(Editor+%231,+Compiler+%231)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4