From 995046865885827b79226597586736fd0846cf71 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 3 Jan 2018 10:24:40 +0100 Subject: [PATCH] Handle noipa attribute in IPA visibility (PR ipa/83594). 2018-01-03 Martin Liska PR ipa/83594 * ipa-visibility.c (function_and_variable_visibility): Skip functions with noipa attribure. 2018-01-03 Martin Liska PR ipa/83594 * gcc.dg/ipa/pr83594.c: New test. From-SVN: r256167 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-visibility.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/ipa/pr83594.c | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr83594.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e86e97b755..6ca0368a26a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-03 Martin Liska + + PR ipa/83594 + * ipa-visibility.c (function_and_variable_visibility): Skip + functions with noipa attribure. + 2018-01-03 Jakub Jelinek * gcc.c (process_command): Update copyright notice dates. diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index b6bc870b11d..9f136d9069c 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -623,7 +623,8 @@ function_and_variable_visibility (bool whole_program) { if (node->get_availability () != AVAIL_INTERPOSABLE || DECL_EXTERNAL (node->decl) - || node->has_aliases_p ()) + || node->has_aliases_p () + || lookup_attribute ("noipa", DECL_ATTRIBUTES (node->decl))) continue; cgraph_node *alias = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a61567618cc..f4fdd0da7a7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-03 Martin Liska + + PR ipa/83594 + * gcc.dg/ipa/pr83594.c: New test. + 2018-01-03 Richard Sandiford Alan Hayward David Sherwood diff --git a/gcc/testsuite/gcc.dg/ipa/pr83594.c b/gcc/testsuite/gcc.dg/ipa/pr83594.c new file mode 100644 index 00000000000..1927c636ec0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr83594.c @@ -0,0 +1,5 @@ +__attribute__((noipa)) +void foo () +{ + foo (); +} -- 2.30.2