public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/45632] const function pointer propagation issues with inlining
Date: Fri, 21 Oct 2011 14:08:00 -0000	[thread overview]
Message-ID: <bug-45632-4-nT5UaaAa6e@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-45632-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45632

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-10-21 14:07:53 UTC ---
Is the second call to func() in main we pass the pointer p again, p2
being basically thrown away, I think that is a mistake because this
way, there isn't actually any call to b_foo in the testcase, just two
calls to a_foo.

BTW, currently (at -O3 and on i686) not even these calls to a_foo is
inlined.  Just one of them is direct but the other one is not, presumably
because we don't believe in the constantness of *p over the first call
at this stage.  When I change the testcase to pass p2 to the second
invocation of func, neither a_foo nor b_foo are inlined either.

So it seems to me that in order to inline both cases we'd need
aggregate return functions that we would be able to combine with
indirect cgraph edges at inlining time.  Tough.


       reply	other threads:[~2011-10-21 14:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-45632-4@http.gcc.gnu.org/bugzilla/>
2011-10-21 14:08 ` jamborm at gcc dot gnu.org [this message]
2021-08-05 23:57 ` [Bug tree-optimization/45632] " pinskia at gcc dot gnu.org
2010-09-10  8:50 [Bug middle-end/45632] New: " andi-gcc at firstfloor dot org
2010-09-10  8:51 ` [Bug middle-end/45632] " andi-gcc at firstfloor dot org
2010-09-10  9:28 ` rguenth at gcc dot gnu dot 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-45632-4-nT5UaaAa6e@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).