public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/106816] noreturn/pure attributes are not set correctly on multiversioned functions
Date: Fri, 02 Sep 2022 18:39:56 +0000	[thread overview]
Message-ID: <bug-106816-4-jFjwEsg8VN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106816-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Simon Rainer from comment #2)
> (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.

I got

main:
.LFB2:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    _Z5_Z1fvv
        .cfi_endproc

It looks correct.

  parent reply	other threads:[~2022-09-02 18:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 15:34 [Bug ipa/106816] New: " gcc.gnu at vvalter dot com
2022-09-02 17:26 ` [Bug ipa/106816] " hjl.tools at gmail dot com
2022-09-02 17:55 ` gcc.gnu at vvalter dot com
2022-09-02 18:39 ` hjl.tools at gmail dot com [this message]
2022-09-02 19:48 ` gcc.gnu at vvalter dot com
2022-09-05 10:02 ` rguenth at gcc dot gnu.org
2022-09-14 13:58 ` marxin at gcc dot gnu.org
2022-09-14 13:59 ` marxin at gcc dot gnu.org
2022-12-28 14:50 ` marxin at gcc dot gnu.org
2023-01-03 10:27 ` jamborm at gcc dot gnu.org
2023-01-06 15:17 ` marxin at gcc dot gnu.org
2023-04-03  9:03 ` marxin at gcc dot gnu.org
2023-04-26  6:56 ` rguenth at gcc dot gnu.org
2023-07-27  9:23 ` rguenth at gcc dot gnu.org
2024-05-21  9:12 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106816-4-jFjwEsg8VN@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).