[PATCH] Function Multiversioning Bug, checking for function versions
Jakub Jelinek
jakub@redhat.com
Wed Jan 2 21:01:00 GMT 2013
On Wed, Jan 02, 2013 at 12:23:45PM -0800, Sriraman Tallam wrote:
> --- config/i386/i386.c (revision 194817)
> +++ config/i386/i386.c (working copy)
> @@ -29290,7 +29290,7 @@ ix86_get_function_versions_dispatcher (void *decl)
>
> /* Set the dispatcher for all the versions. */
> it_v = default_version_info;
> - while (it_v->next != NULL)
> + while (it_v != NULL)
> {
> it_v->dispatcher_resolver = dispatch_decl;
> it_v = it_v->next;
> @@ -29626,8 +29626,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
> {"avx2", F_AVX2}
> };
>
> - static tree __processor_model_type = NULL_TREE;
> - static tree __cpu_model_var = NULL_TREE;
> + tree __processor_model_type = NULL_TREE;
> + tree __cpu_model_var = NULL_TREE;
>
> if (__processor_model_type == NULL_TREE)
> __processor_model_type = build_processor_model_struct ();
If __processor_model_type is always NULL_TREE above, then you should write
tree __processor_model_type = build_processor_model_struct ();
rather than the extra if with an always true condition.
Jakub
More information about the Gcc-patches
mailing list