From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 5E2463856DD6 for ; Fri, 22 Apr 2022 07:36:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E2463856DD6 Received: from [IPv6:240e:358:1120:b500:dc73:854d:832e:4] (unknown [IPv6:240e:358:1120:b500:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 0D98566541; Fri, 22 Apr 2022 03:36:40 -0400 (EDT) Message-ID: <8cb9e6d0e8ece312768d0cb373cb05ca8e8e13d4.camel@mengyan1223.wang> Subject: Re: Compile time errors on using target attribute for Function Multi Versioning From: Xi Ruoyao To: "Raut, S Biplab" , "gcc-help@gcc.gnu.org" Date: Fri, 22 Apr 2022 15:36:32 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3029.8 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2022 07:36:46 -0000 On Fri, 2022-04-22 at 07:09 +0000, Raut, S Biplab via Gcc-help wrote: > Hi All, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 I want to support = Function Multi Versioning (FMV) in my code > by using GCC's "target" attribute. > Few functions in my program are hand-written intrinsic codes, so I > would prefer to use "target" over "target_clones" attribute. > But, I am getting function redefinition errors for the multiple > versions of the function when I try to compile the test program. >=20 > Please find the details below: > Source code is based on:- > https://gcc.gnu.org/wiki/FunctionMultiVersioning#:~:text=3D1%20__attribut= e__%20((target,return%200%3B%0A%20%2033%20%7D Please read the page carefully: "Support is only available in C++ for i386 targets." --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University