[Bug target/78417] target_clones default for powerpc64

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 19 10:05:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78417

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/config/rs6000/rs6000.c.jj       2016-11-18 20:04:31.000000000 +0100
+++ gcc/config/rs6000/rs6000.c  2016-11-19 10:12:51.018816976 +0100
@@ -38141,6 +38141,14 @@ rs6000_valid_attribute_p (tree fndecl,
                          tree args,
                          int flags)
 {
+  /* attribute((target("default"))) does nothing, beyond
+     affecting multi-versioning.  */
+  if (TREE_VALUE (args)
+      && TREE_CODE (TREE_VALUE (args)) == STRING_CST
+      && TREE_CHAIN (args) == NULL_TREE
+      && strcmp (TREE_STRING_POINTER (TREE_VALUE (args)), "default") == 0)
+    return true;
+
   struct cl_target_option cur_target;
   bool ret;
   tree old_optimize = build_optimization_node (&global_options);

isn't sufficient for this, one needs to implement
TARGET_GENERATE_VERSION_DISPATCHER_BODY
TARGET_GET_FUNCTION_VERSIONS_DISPATCHER
as well.

OT, Thomas, in libgfortran using cpu=power7,cpu=power8 shouldn't be done on if
power8 is already enabled by default (such as on powerpc64le).  Guess you want
cpu=power9,default in that case (of course only once the multi-versioning
support will be implemented for power, if it will.


More information about the Gcc-bugs mailing list