The more expensive code path should only be taken if it can be optimized
away.
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h
(_SimdWrapper::_M_is_constprop_none_of)
(_SimdWrapper::_M_is_constprop_all_of): Return false unless the
computed result still satisfies __builtin_constant_p.
else
__execute_n_times<_Width>(
[&](auto __i) { __r &= _M_data[__i.value] == _Tp(); });
- return __r;
+ if (__builtin_constant_p(__r))
+ return __r;
}
return false;
}
else
__execute_n_times<_Width>(
[&](auto __i) { __r &= _M_data[__i.value] == ~_Tp(); });
- return __r;
+ if (__builtin_constant_p(__r))
+ return __r;
}
return false;
}