Patchwork User directed Function Multiversioning via Function Overloading (issue5752064)

login
register
mail settings
Submitter Gerald Pfeifer
Date Nov. 6, 2012, 10:14 p.m.
Message ID <alpine.LNX.2.00.1211061911490.3550@tuna.site>
Download mbox | patch
Permalink /patch/197561/
State New
Headers show

Comments

Gerald Pfeifer - Nov. 6, 2012, 10:14 p.m.
On Mon, 5 Nov 2012, Sriraman Tallam wrote:
>    I have now committed the attached patch.

...and broke bootstrap on *-unknown-freebsd* and other targets
that way:

   /scratch2/tmp/gerald/gcc-HEAD/gcc/config/i386/i386.c:28820:1: error: 
   'tree_node* make_dispatcher_decl(tree)' defined but not used 
   [-Werror=unused-function]
    make_dispatcher_decl (const tree decl)
    ^
   cc1plus: all warnings being treated as errors

To restore bootstrap, I applied the patch below after testing on
i386-unknown-freebsd10.0.

Gerald


2012-11-06  Gerald Pfeifer  <gerald@pfeifer.com>

	* config/i386/i386.c (make_dispatcher_decl): Guard with
	ASM_OUTPUT_TYPE_DIRECTIVE and HAVE_GNU_INDIRECT_FUNCTION.

Patch

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 193259)
+++ config/i386/i386.c	(working copy)
@@ -28813,6 +28813,8 @@ 
   return global_var_name;
 }
 
+#if defined (ASM_OUTPUT_TYPE_DIRECTIVE) && HAVE_GNU_INDIRECT_FUNCTION
+
 /* Make a dispatcher declaration for the multi-versioned function DECL.
    Calls to DECL function will be replaced with calls to the dispatcher
    by the front-end.  Return the decl created.  */
@@ -28850,6 +28852,8 @@ 
   return func_decl;  
 }
 
+#endif
+
 /* Returns true if decl is multi-versioned and DECL is the default function,
    that is it is not tagged with target specific optimization.  */