User directed Function Multiversioning via Function Overloading (issue5752064)

Jason Merrill jason@redhat.com
Mon Nov 12 05:04:00 GMT 2012


On 11/09/2012 08:33 PM, Sriraman Tallam wrote:
> +	  /* Skip calling decls_match for versioned functions.  */
> +          if (DECL_FUNCTION_VERSIONED (fn)
> +	      && DECL_FUNCTION_VERSIONED (TREE_PURPOSE (match)))
> +	    continue;
> +	  if (!decls_match (fn, TREE_PURPOSE (match)))
> +            break;

This seems like it would allow multiple versioned functions from 
different namespaces; I want to allow mismatches only if they are 
versions of the same function.  I was thinking

          for (match = TREE_CHAIN (matches); match; match = TREE_CHAIN 
(match))
   	    if (!decls_match (fn, TREE_PURPOSE (match))
                 && !targetm.target_option.function_versions (fn, 
TREE_PURPOSE (match)))
	      break;

> +      error_at (input_location, "Call/Pointer to multiversioned function"
> +                " without a default cannot be dispatched");

Let's just say "use of multiversioned  function without a default".

Jason



More information about the Gcc-patches mailing list