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

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |linkw at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #14 from Kewen Lin <linkw at gcc dot gnu.org> ---
Both the reduced test case and the upstream code
(https://github.com/google/highway/blob/master/hwy/base.h) have empty inline
asm string, one quick simple fix can treat empty asm string specially:

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index efe9adce1f8..6ef75164d08 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -25475,9 +25475,11 @@ rs6000_update_ipa_fn_target_info (unsigned int &info,
const gimple *stmt)
   /* Assume inline asm can use any instruction features.  */
   if (gimple_code (stmt) == GIMPLE_ASM)
     {
-      /* Should set any bits we concerned, for now OPTION_MASK_HTM is
-         the only bit we care about.  */
-      info |= RS6000_FN_TARGET_INFO_HTM;
+      const char *asm_str = gimple_asm_string (as_a<const gasm *> (stmt));
+      if (strlen (asm_str) > 0)
+        /* Should set any bits we concerned, for now OPTION_MASK_HTM is
+           the only bit we care about.  */
+        info |= RS6000_FN_TARGET_INFO_HTM;
       return false;
     }
   else if (gimple_code (stmt) == GIMPLE_CALL)

Reply via email to