This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Function Multiversioning in GCC6
- From: Xi Ruoyao <ryxi at stu dot xidian dot edu dot cn>
- To: "O Mahony, Billy" <billy dot o dot mahony at intel dot com>
- Cc: ryxi at stu dot xidian dot edu dot cn, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 23 Mar 2017 17:21:03 +0800
- Subject: Re: Function Multiversioning in GCC6
- Authentication-results: sourceware.org; auth=none
- References: <03135AEA779D444E90975C2703F148DC2F89092D@IRSMSX107.ger.corp.intel.com>
On 2017-03-22 10:51 +0000, O Mahony, Billy wrote:
> However when I compile the first example in
> this LWN article https://lwn.net/Articles/691932/ with gcc-6 C compiler it fails with (error: redefinition of
> 'foo'...) .
The document <https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Function-Multiversioning.html> said:
With the GNU *C++* front end, for x86 targets, you may specify multiple versions of the function.
FMV doesn't work with C FE. In C, __attribute__((target("sse4.2"))) just means to compile this function
with -msse4.2, see <https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Common-Function-Attributes.html>.
--
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University