Message ID | CAAs8HmzTimSvEUXQ7AMLi2Q2Y+=RmCs8FkLpDZTpRmNkLBUxgQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
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
On Wed, Jan 2, 2013 at 1:01 PM, Jakub Jelinek <jakub@redhat.com> wrote: > 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. Right, sorry! Oversight in a hurry to fix the bug. -Sri. > > Jakub
Index: config/i386/i386.c =================================================================== --- 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 ();