https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289103

            Bug ID: 289103
           Summary: The C++ code fails in clang and succeeds in gcc
           Product: Base System
           Version: 14.3-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 263238
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=263238&action=edit
testcase.shar

The attached testcase fails in clang but succeeds in gcc.

They do some manipulations with SIMD vectors.

This code is extracted from the port audio/cardinal.
It succeeds in 14.2 but fails in 14.3 - likely due to clang update.

The error messages:

$ ./run.sh 
In file included from main.cpp:3:
In file included from /usr/include/c++/v1/complex:266:
In file included from /usr/include/c++/v1/cmath:316:
In file included from /usr/include/c++/v1/__math/hypot.h:15:
In file included from /usr/include/c++/v1/__math/exponential_functions.h:17:
/usr/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion
failed due to requirement 'is_arithmetic<rack::simd::Vector<float, 4>>::value'
   32 |   static_assert((is_arithmetic<_Args>::value && ...));
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/complex:1110:47: note: in instantiation of template class
'std::__promote<rack::simd::Vector<float, 4>, float>' requested here
 1110 | inline _LIBCPP_HIDE_FROM_ABI complex<typename __promote<_Tp,
_Up>::type> pow(const complex<_Tp>& __x, const _Up& __y) {
      |                                               ^
main.cpp:182:43: note: while substituting deduced template arguments into
function template 'pow' [with _Tp = rack::simd::float_4, _Up = float, $2 = (no
value)]
  182 |         rack::simd::float_4 globalSends =
rack::simd::pow<rack::simd::float_4>(globalSends,
globalAuxSendScalingExponent);
      |                                           ^
main.cpp:182:80: warning: variable 'globalSends' is uninitialized when used
within its own initialization [-Wuninitialized]
  182 |         rack::simd::float_4 globalSends =
rack::simd::pow<rack::simd::float_4>(globalSends,
globalAuxSendScalingExponent);
      |                             ~~~~~~~~~~~                                
       ^~~~~~~~~~~
1 warning and 1 error generated.
[yuri@yv /usr/ports/audio/cardinal/testcase]$

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to