From: Jan Hubicka <hubicka@ucw.cz>
To: "Martin Liška" <mliska@suse.cz>
Cc: Yuri Gribov <tetra2005@gmail.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520).
Date: Mon, 24 Jul 2017 14:06:00 -0000 [thread overview]
Message-ID: <20170724140622.GB90943@kam.mff.cuni.cz> (raw)
In-Reply-To: <eab80d41-2d78-d99b-ddef-9f6535c7156a@suse.cz>
> >From 046931ec490d20a6c003094367f7f0bfae64647f Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Mon, 24 Jul 2017 11:21:18 +0200
> Subject: [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520).
>
> gcc/ChangeLog:
>
> 2017-07-24 Martin Liska <mliska@suse.cz>
>
> PR ipa/81520
> * ipa-visibility.c (function_and_variable_visibility): Make the redirection
> just on target that do supporting aliasing. Fix GNU coding style.
>
> gcc/testsuite/ChangeLog:
>
> 2017-07-24 Martin Liska <mliska@suse.cz>
>
> PR ipa/81520
> * gcc.dg/ipa/pr81520.c: New test.
OK, we probably should turn ASM_OUTPUT_DEF ifdefs into a conditional compilation
incrementally.
Thanks,
Honza
> ---
> gcc/ipa-visibility.c | 11 +++++++----
> gcc/testsuite/gcc.dg/ipa/pr81520.c | 11 +++++++++++
> 2 files changed, 18 insertions(+), 4 deletions(-)
> create mode 100644 gcc/testsuite/gcc.dg/ipa/pr81520.c
>
> diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c
> index 21321703dbb..13cf2a3a1cf 100644
> --- a/gcc/ipa-visibility.c
> +++ b/gcc/ipa-visibility.c
> @@ -615,9 +615,10 @@ function_and_variable_visibility (bool whole_program)
> struct cgraph_node *node;
> varpool_node *vnode;
>
> - /* All aliases should be procssed at this point. */
> + /* All aliases should be processed at this point. */
> gcc_checking_assert (!alias_pairs || !alias_pairs->length ());
>
> +#ifdef ASM_OUTPUT_DEF
> FOR_EACH_DEFINED_FUNCTION (node)
> {
> if (node->get_availability () != AVAIL_INTERPOSABLE
> @@ -634,20 +635,22 @@ function_and_variable_visibility (bool whole_program)
> continue;
>
> if (!alias)
> - {
> + {
> alias = dyn_cast<cgraph_node *> (node->noninterposable_alias ());
> gcc_assert (alias && alias != node);
> }
>
> e->redirect_callee (alias);
> if (gimple_has_body_p (e->caller->decl))
> - {
> + {
> push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
> e->redirect_call_stmt_to_callee ();
> - pop_cfun ();
> + pop_cfun ();
> }
> }
> }
> +#endif
> +
> FOR_EACH_FUNCTION (node)
> {
> int flags = flags_from_decl_or_type (node->decl);
> diff --git a/gcc/testsuite/gcc.dg/ipa/pr81520.c b/gcc/testsuite/gcc.dg/ipa/pr81520.c
> new file mode 100644
> index 00000000000..b5d33d2dc96
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/ipa/pr81520.c
> @@ -0,0 +1,11 @@
> +/* PR ipa/81520 */
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fPIC" } */
> +/* { dg-require-effective-target fpic } */
> +
> +char
> +a (int b)
> +{
> + a (b);
> + return 0;
> +}
> --
> 2.13.3
>
next prev parent reply other threads:[~2017-07-24 14:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-17 7:22 [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls 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 [this message]
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 ` [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls Jan Hubicka
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=20170724140622.GB90943@kam.mff.cuni.cz \
--to=hubicka@ucw.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=mliska@suse.cz \
--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).