re PR ipa/81238 (Target clone support does not make default clone static.)
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Wed, 28 Jun 2017 13:07:12 +0000 (13:07 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 28 Jun 2017 13:07:12 +0000 (13:07 +0000)
[gcc]
2017-06-28  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR ipa/81238
* multiple_target.c (create_dispatcher_calls): Set the default
clone to be static, not public.

[gcc/testsuite]
2017-06-28  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/81193
* lib/target-supports.exp
(check_ppc_cpu_supports_hw_available): New test to make sure
__builtin_cpu_supports works on power7 and newer.

From-SVN: r249737

gcc/ChangeLog
gcc/multiple_target.c
gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index dc94164a21cc501f19fcd6fb5ed9a742c3ef4d6d..e2d7261795b7ac2fc8b4f1053592c7ecbe826f3a 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-28  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR ipa/81238
+       * multiple_target.c (create_dispatcher_calls): Set the default
+       clone to be static, not public.
+
 2017-06-28  Richard Biener  <rguenther@suse.de>
 
        * tree-vect-loop.c (vectorizable_reduction): Move special
index 38d6892af282a90609473cfc6bdb6319f68d54ee..eddc7d3744b7a805495a30e24c81dc2ca0018813 100644 (file)
@@ -148,6 +148,7 @@ create_dispatcher_calls (struct cgraph_node *node)
        }
     }
 
+  TREE_PUBLIC (node->decl) = 0;
   symtab->change_decl_assembler_name (node->decl,
                                      clone_function_name (node->decl,
                                                           "default"));
index ed6f8a6b7f995b2ffa0cc085aef6c2972a0b7a8a..d50a9d8c646acb1f741a75b94547c00dad5b72e1 100644 (file)
@@ -1,3 +1,10 @@
+2017-06-28  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR target/81193
+       * lib/target-supports.exp
+       (check_ppc_cpu_supports_hw_available): New test to make sure
+       __builtin_cpu_supports works on power7 and newer.
+
 2017-06-28  Martin Liska  <mliska@suse.cz>
 
        PR ipa/81128
index f6e24401879429c2ef1a5dc9f50ff980eafcc1f3..1583b27a46e1be46fcd025b26ab71110e8d31b16 100644 (file)
@@ -1930,6 +1930,37 @@ proc check_effective_target_powerpc64_no_dm { } {
        } {-O2}]
 }
 
+# Return 1 if the target supports the __builtin_cpu_supports built-in,
+# including having a new enough library to support the test.  Cache the result.
+# Require at least a power7 to run on.
+
+proc check_ppc_cpu_supports_hw_available { } {
+    return [check_cached_effective_target ppc_cpu_supports_hw_available {
+       # Some simulators are known to not support VSX/power8 instructions.
+       # For now, disable on Darwin
+       if { [istarget powerpc-*-eabi]
+            || [istarget powerpc*-*-eabispe]
+            || [istarget *-*-darwin*]} {
+           expr 0
+       } else {
+           set options "-mvsx"
+           check_runtime_nocache ppc_cpu_supports_hw_available {
+               int main()
+               {
+               #ifdef __MACH__
+                 asm volatile ("xxlor vs0,vs0,vs0");
+               #else
+                 asm volatile ("xxlor 0,0,0");
+               #endif
+                 if (!__builtin_cpu_supports ("vsx"))
+                   return 1;
+                 return 0;
+               }
+           } $options
+       }
+    }]
+}
+
 # Return 1 if the target supports executing power8 vector instructions, 0
 # otherwise.  Cache the result.
 
@@ -6955,6 +6986,7 @@ proc is-effective-target { arg } {
          "ppc_float128_sw" { set selected [check_ppc_float128_sw_available] }
          "ppc_float128_hw" { set selected [check_ppc_float128_hw_available] }
          "ppc_recip_hw"   { set selected [check_ppc_recip_hw_available] }
+         "ppc_cpu_supports_hw" { set selected [check_ppc_cpu_supports_hw_available] }
          "dfp_hw"         { set selected [check_dfp_hw_available] }
          "htm_hw"         { set selected [check_htm_hw_available] }
          "named_sections" { set selected [check_named_sections_available] }