diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-07-25 10:20:23 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-07-25 10:20:23 +0000 |
commit | c8f03f886912cf080ad33cec47e67a7f168bc555 (patch) | |
tree | 1e38862eae269e11ace01ef2f2e920752af4cfce | |
parent | e840a46762047896d2fa2a3409e271e54bda9059 (diff) | |
download | gcc-c8f03f886912cf080ad33cec47e67a7f168bc555.tar.gz |
Fix wrong condition in ipa-visibility.c (PR ipa/81520).
2017-07-25 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.
2017-07-25 Martin Liska <mliska@suse.cz>
PR ipa/81520
* gcc.dg/ipa/pr81520.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250501 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-visibility.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/pr81520.c | 11 |
4 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa58d51012b..9177c6a8f5b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-25 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. + 2017-07-25 Sebastian Huber <sebastian.huber@embedded-brains.de> PR libgcc/61152 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/ChangeLog b/gcc/testsuite/ChangeLog index f3a4812308c..2762ae5b70f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-07-25 Martin Liska <mliska@suse.cz> + + PR ipa/81520 + * gcc.dg/ipa/pr81520.c: New test. + 2017-07-25 Marek Polacek <polacek@redhat.com> PR c/81364 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; +} |