summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-01-03 10:24:40 +0100
committerMartin Liska <marxin@gcc.gnu.org>2018-01-03 09:24:40 +0000
commit995046865885827b79226597586736fd0846cf71 (patch)
tree8f26454cf98ddef508ccdaf91405660422701959
parent65e6aea386e244e87fd9a745887cd9c59431e33f (diff)
downloadgcc-995046865885827b79226597586736fd0846cf71.tar.gz
Handle noipa attribute in IPA visibility (PR ipa/83594).
2018-01-03 Martin Liska <mliska@suse.cz> PR ipa/83594 * ipa-visibility.c (function_and_variable_visibility): Skip functions with noipa attribure. 2018-01-03 Martin Liska <mliska@suse.cz> PR ipa/83594 * gcc.dg/ipa/pr83594.c: New test. From-SVN: r256167
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-visibility.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr83594.c5
4 files changed, 18 insertions, 1 deletions
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 <mliska@suse.cz>
+
+ PR ipa/83594
+ * ipa-visibility.c (function_and_variable_visibility): Skip
+ functions with noipa attribure.
+
2018-01-03 Jakub Jelinek <jakub@redhat.com>
* 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 <mliska@suse.cz>
+
+ PR ipa/83594
+ * gcc.dg/ipa/pr83594.c: New test.
+
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
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 ();
+}