https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106816

--- Comment #2 from Simon Rainer <gcc.gnu at vvalter dot com> ---
(In reply to H.J. Lu from comment #1)
> Like this?
> 
> diff --git a/gcc/config/i386/i386-features.cc
> b/gcc/config/i386/i386-features.cc
> index fd212262f50..4904e4d71b3 100644
> --- a/gcc/config/i386/i386-features.cc
> +++ b/gcc/config/i386/i386-features.cc
> @@ -3269,6 +3269,9 @@ ix86_get_function_versions_dispatcher (void *decl)
>        /* Right now, the dispatching is done via ifunc.  */
>        dispatch_decl = make_dispatcher_decl (default_node->decl);
>        TREE_NOTHROW (dispatch_decl) = TREE_NOTHROW (fn);
> +      TREE_THIS_VOLATILE (dispatch_decl) = TREE_THIS_VOLATILE (fn);
> +      TREE_READONLY (dispatch_decl) = TREE_READONLY (fn);
> +      DECL_PURE_P (dispatch_decl) = DECL_PURE_P (fn);
>  
>        dispatcher_node = cgraph_node::get_create (dispatch_decl);
>        gcc_assert (dispatcher_node != NULL);

I tried something like that, but I didn't see changes in the generated
assembly. I don't know if that is because something else is preventing
optimization or some other member needs to be set correctly.

Reply via email to