From 926c786507a69f31253d6c904cf582b9ba162ded Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Wed, 28 Jun 2017 13:07:12 +0000 Subject: [PATCH] re PR ipa/81238 (Target clone support does not make default clone static.) [gcc] 2017-06-28 Michael Meissner 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 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 | 6 +++++ gcc/multiple_target.c | 1 + gcc/testsuite/ChangeLog | 7 ++++++ gcc/testsuite/lib/target-supports.exp | 32 +++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc94164a21c..e2d7261795b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-28 Michael Meissner + + PR ipa/81238 + * multiple_target.c (create_dispatcher_calls): Set the default + clone to be static, not public. + 2017-06-28 Richard Biener * tree-vect-loop.c (vectorizable_reduction): Move special diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c index 38d6892af28..eddc7d3744b 100644 --- a/gcc/multiple_target.c +++ b/gcc/multiple_target.c @@ -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")); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed6f8a6b7f9..d50a9d8c646 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-06-28 Michael Meissner + + 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 PR ipa/81128 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f6e24401879..1583b27a46e 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -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] } -- 2.30.2