public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Yuri Gribov <tetra2005@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls
Date: Wed, 02 Aug 2017 09:47:00 -0000	[thread overview]
Message-ID: <20170802094732.GC98370@kam.mff.cuni.cz> (raw)
In-Reply-To: <CAJOtW+5OWN2Wv0uFiEaOXUGu0zqCDmgJqSRDXPVh1HX5tzEkwA@mail.gmail.com>

Hi,
> On Mon, Jul 17, 2017 at 10:27 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> Hi all,
> >>
> >> This is a new version of previous patch
> >> (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed
> >> after Rainer's remarks.
> > Hi,
> > the patch looks OK, but I wonder why you included can_be_discarded check?
> > If function is in comdat I believe the optimization still can happen.
> > Perhaps you only want to check DECL_EXTERNAL?
> 
> TBH I was inspired by can_replace_by_local_alias which prohibits local
> alias for discardable functions.  But I agree that situation here is
> different and it's indeed not needed (if function is discarded, it
> does not matter whether we optimized recursive calls).
> 
> Could you elaborate why we still need DECL_EXTERNAL though?

I you have DECL_EXTERNAl function, its definition lives only until inlining
and then all offline copies are  replaced by external calls.  So if you create
alias for recusive call you will probably end up with an ICE.

Honza

> 
> -Y

      parent reply	other threads:[~2017-08-02  9:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17  7:22 Yuri Gribov
2017-07-17  9:27 ` Jan Hubicka
2017-07-18  8:27   ` Yuri Gribov
2017-07-24 12:52     ` [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520) Martin Liška
2017-07-24 14:06       ` Jan Hubicka
2017-07-31  8:04         ` [PATCH] Introduce TARGET_SUPPORTS_ALIASES Martin Liška
2017-07-31  9:58           ` Yuri Gribov
2017-07-31 11:22             ` [PATCH][v2] " Martin Liška
2017-08-10 13:49               ` Jan Hubicka
2023-09-08 12:02                 ` More '#ifdef ASM_OUTPUT_DEF' -> 'if (TARGET_SUPPORTS_ALIASES)' etc. (was: [PATCH][v2] Introduce TARGET_SUPPORTS_ALIASES) Thomas Schwinge
2023-09-19  8:47                   ` [PING] " Thomas Schwinge
2023-10-25  8:38                     ` [PING^2] " Thomas Schwinge
2023-10-25 16:19                       ` [PING^2] More '#ifdef ASM_OUTPUT_DEF' -> 'if (TARGET_SUPPORTS_ALIASES)' etc Jeff Law
2017-07-25  4:20       ` [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520) Yuri Gribov
2017-08-02  9:47     ` Jan Hubicka [this message]

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=20170802094732.GC98370@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tetra2005@gmail.com \
    /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).