@@ -25475,9 +25475,12 @@ 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));
+ /* Ignore empty inline asm string. */
+ 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)
new file mode 100644
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* Use -Wno-attributes to suppress the possible warning on always_inline. */
+/* { dg-options "-O2 -mdejagnu-cpu=power9 -Wno-attributes" } */
+
+/* Verify it doesn't emit any error messages. */
+
+#include <stddef.h>
+#define HWY_PRAGMA(tokens) _Pragma (#tokens)
+#define HWY_PUSH_ATTRIBUTES(targets_str) HWY_PRAGMA (GCC target targets_str)
+__attribute__ ((always_inline)) void
+PreventElision ()
+{
+ asm("");
+}
+#define HWY_BEFORE_NAMESPACE() HWY_PUSH_ATTRIBUTES (",cpu=power10")
+HWY_BEFORE_NAMESPACE () namespace detail
+{
+ template <typename, size_t, int> struct CappedTagChecker
+ {
+ };
+}
+template <typename T, size_t kLimit, int kPow2 = 0>
+using CappedTag = detail::CappedTagChecker<T, kLimit, kPow2>;
+template <typename, size_t, size_t kMinArg, class Test> struct ForeachCappedR
+{
+ static void Do (size_t, size_t)
+ {
+ CappedTag<int, kMinArg> d;
+ Test () (int(), d);
+ }
+};
+template <class Test> struct ForPartialVectors
+{
+ template <typename T> void operator() (T)
+ {
+ ForeachCappedR<T, 1, 1, Test>::Do (1, 1);
+ }
+};
+struct TestFloorLog2
+{
+ template <class T, class DF> void operator() (T, DF) { PreventElision (); }
+};
+void
+TestAllFloorLog2 ()
+{
+ ForPartialVectors<TestFloorLog2> () (float());
+}
+