public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/60973] Invalid propagation of a tail call in devirt pass
Date: Fri, 09 May 2014 14:27:00 -0000	[thread overview]
Message-ID: <bug-60973-4-CXnSJYB5MJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60973-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Jan Hubicka <hubicka at ucw dot cz> ---
> Before tunks we never bothered to compute [tailcall] before inlining
> completed, but now explicitely setting the flag for thunks (and not letting
> it be computed - why wouldn't that work?) breaks this.
> 
> So not setting the flag explicitely in expand_thunk looks like a better fix
> to me?

We always had this explicit set of tailcall in thunk expansion code -
originally
in C++ frontend and at early LTO times I just literaly moved it to cgraphunit.
This patch http://gcc.gnu.org/ml/gcc-patches/2013-09/msg01035.html makes it
possible that tunks are inlined since we lower them to gimple bodies early
and it is why things breaks now as inliner does not expect it.

My initial reaction (written in previously comment) was also that tailcall
should
discover the flags themself and we could avoid setting them in the thunk
expansion.
Sadly I think it is not quite the case; tailcall is very conservative and I
believe
it will give up in cases where thunks are possible.  Also it is not run at -O0
and for thunks we want the tailcall to happen since it only improves debugging
exprience and saves codegen time...

So I would probably say we should fix that in tree-inline as your patch
propose.


  parent reply	other threads:[~2014-05-09 14:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26  8:27 [Bug tree-optimization/60973] New: Invalid propagation of a tail call in copyrename2 pass ubizjak at gmail dot com
2014-04-28  9:49 ` [Bug ipa/60973] Invalid propagation of a tail call in devirt pass rguenth at gcc dot gnu.org
2014-05-06 11:28 ` hubicka at gcc dot gnu.org
2014-05-07 18:10 ` ubizjak at gmail dot com
2014-05-09 10:56 ` rguenth at gcc dot gnu.org
2014-05-09 14:27 ` hubicka at ucw dot cz [this message]
2014-05-13  7:57 ` rguenth at gcc dot gnu.org
2014-05-13 11:05 ` rguenth at gcc dot gnu.org
2014-05-13 11:06 ` rguenth at gcc dot gnu.org
2014-05-13 11:06 ` rguenth 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-60973-4-CXnSJYB5MJ@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).