Handle noipa attribute in IPA visibility (PR ipa/83594).
authorMartin Liska <mliska@suse.cz>
Wed, 3 Jan 2018 09:24:40 +0000 (10:24 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 3 Jan 2018 09:24:40 +0000 (09:24 +0000)
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

gcc/ChangeLog
gcc/ipa-visibility.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/pr83594.c [new file with mode: 0644]

index 5e86e97b7558ed4a26071f5ca59140b08fb4d443..6ca0368a26a5419d292ead7432cfcc71c1894d64 100644 (file)
@@ -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.
index b6bc870b11de4539fc291ecfad39dd35cf12ec9d..9f136d9069ccf863b33cc589066216046279ecd8 100644 (file)
@@ -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;
index a61567618cce55f634cefff8b8f6ee776355d327..f4fdd0da7a7ff4a21f732af79aaa19cdfdd34ae8 100644 (file)
@@ -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 (file)
index 0000000..1927c63
--- /dev/null
@@ -0,0 +1,5 @@
+__attribute__((noipa))
+void foo ()
+{
+  foo ();
+}