kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.66k stars 253 forks source link

Internal compiler error #194

Closed aybe closed 11 months ago

aybe commented 1 year ago

Using Visual Studio 2022 and vcpkg package.

The example that triggers it:

https://github.com/aybe/KFRTest/blob/reverb/KFRTest/KFRTest.cpp

The line where it happens:

https://github.com/kfrlib/kfr/blob/main/include/kfr/math/impl/log_exp.hpp#L54

The build output:

Build started...
1>------ Build started: Project: KFRTest, Configuration: Release x64 ------
1>KFRTest.cpp
1>C:\vcpkg\installed\x64-windows\include\kfr\graphics\color.hpp(166,97): warning C4244: 'argument': conversion from 'unsigned __int64' to 'uint32_t', possible loss of data
1>C:\vcpkg\installed\x64-windows\include\kfr\graphics\color.hpp(170,44): warning C4244: 'argument': conversion from 'unsigned __int64' to 'uint32_t', possible loss of data
1>C:\vcpkg\installed\x64-windows\include\kfr\simd\vec.hpp(706,30): warning C4244: 'argument': conversion from 'const From' to 'cometa::i32', possible loss of data
1>        with
1>        [
1>            From=double
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\base\conversion.hpp(186,12): message : see reference to function template instantiation 'Tout kfr::sse2::broadcastto<type,double,kfr::i24>(const From &) noexcept' being compiled
1>        with
1>        [
1>            Tout=kfr::i24,
1>            From=double
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\base\conversion.hpp(259,18): message : see reference to function template instantiation 'Tout kfr::sse2::convert_sample<type,Tin,kfr::sse2::audio_sample_traits<kfr::i24>,kfr::sse2::audio_sample_traits<cometa::f64>,true,void,cometa::details::unique_enum_impl<182>::value>(const Tin &)' being compiled
1>        with
1>        [
1>            Tout=type,
1>            Tin=double
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\base\conversion.hpp(283,17): message : see reference to function template instantiation 'void kfr::sse2::convert<type,Tin,kfr::sse2::audio_sample_traits<kfr::i24>,kfr::sse2::audio_sample_traits<cometa::f64>>(Tout *,const Tin *,size_t)' being compiled
1>        with
1>        [
1>            Tin=double,
1>            Tout=type
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\cometa.hpp(1609,16): message : see reference to function template instantiation 'void kfr::sse2::convert::<lambda_1>::operator ()<cometa::cval_t<kfr::audio_sample_type,kfr::audio_sample_type::i24>>(_T1) const' being compiled
1>        with
1>        [
1>            _T1=cometa::cval_t<kfr::audio_sample_type,kfr::audio_sample_type::i24>
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\cometa.hpp(1613,16): message : see reference to function template instantiation 'void cometa::cswitch<kfr::audio_sample_type,kfr::audio_sample_type::i24,kfr::audio_sample_type::i32,kfr::audio_sample_type::i64,kfr::audio_sample_type::f32,kfr::audio_sample_type::f64,_Ty,cometa::fn_noop,cometa::fn_is_equal>(cometa::cvals_t<kfr::audio_sample_type,kfr::audio_sample_type::i24,kfr::audio_sample_type::i32,kfr::audio_sample_type::i64,kfr::audio_sample_type::f32,kfr::audio_sample_type::f64>,kfr::audio_sample_type,Fn &&,DefFn &&,CmpFn &&)' being compiled
1>        with
1>        [
1>            _Ty=kfr::sse2::convert::<lambda_1>,
1>            Fn=kfr::sse2::convert::<lambda_1>,
1>            DefFn=cometa::fn_noop,
1>            CmpFn=cometa::fn_is_equal
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\cometa.hpp(1613,16): message : see reference to function template instantiation 'void cometa::cswitch<kfr::audio_sample_type,kfr::audio_sample_type::i16,kfr::audio_sample_type::i24,kfr::audio_sample_type::i32,kfr::audio_sample_type::i64,kfr::audio_sample_type::f32,kfr::audio_sample_type::f64,_Ty,cometa::fn_noop,cometa::fn_is_equal>(cometa::cvals_t<kfr::audio_sample_type,kfr::audio_sample_type::i16,kfr::audio_sample_type::i24,kfr::audio_sample_type::i32,kfr::audio_sample_type::i64,kfr::audio_sample_type::f32,kfr::audio_sample_type::f64>,kfr::audio_sample_type,Fn &&,DefFn &&,CmpFn &&)' being compiled
1>        with
1>        [
1>            _Ty=kfr::sse2::convert::<lambda_1>,
1>            Fn=kfr::sse2::convert::<lambda_1>,
1>            DefFn=cometa::fn_noop,
1>            CmpFn=cometa::fn_is_equal
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\base\conversion.hpp(279,5): message : see reference to function template instantiation 'void cometa::cswitch<kfr::audio_sample_type,kfr::audio_sample_type::i8,kfr::audio_sample_type::i16,kfr::audio_sample_type::i24,kfr::audio_sample_type::i32,kfr::audio_sample_type::i64,kfr::audio_sample_type::f32,kfr::audio_sample_type::f64,kfr::sse2::convert::<lambda_1>,cometa::fn_noop,cometa::fn_is_equal>(cometa::cvals_t<kfr::audio_sample_type,kfr::audio_sample_type::i8,kfr::audio_sample_type::i16,kfr::audio_sample_type::i24,kfr::audio_sample_type::i32,kfr::audio_sample_type::i64,kfr::audio_sample_type::f32,kfr::audio_sample_type::f64>,kfr::audio_sample_type,Fn &&,DefFn &&,CmpFn &&)' being compiled
1>        with
1>        [
1>            Fn=kfr::sse2::convert::<lambda_1>,
1>            DefFn=cometa::fn_noop,
1>            CmpFn=cometa::fn_is_equal
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\io\audiofile.hpp(216,13): message : see reference to function template instantiation 'void kfr::sse2::convert<T,kfr::sse2::audio_sample_traits<cometa::f64>>(void *,kfr::audio_sample_type,const Tin *,size_t)' being compiled
1>        with
1>        [
1>            T=double,
1>            Tin=double
1>        ]
1>C:\vcpkg\installed\x64-windows\include\kfr\io\audiofile.hpp(201,12): message : while compiling class template member function 'size_t kfr::audio_writer_wav<double>::write(const T *,size_t)'
1>        with
1>        [
1>            T=double
1>        ]
1>C:\GitHub\KFRTest\KFRTest\KFRTest.cpp(27,44): message : see reference to class template instantiation 'kfr::audio_writer_wav<double>' being compiled
1>Generating code
1>C:\vcpkg\installed\x64-windows\include\kfr\math\impl\log_exp.hpp(54): fatal error C1001: Internal compiler error.
1>(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c', line 234)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>If possible please provide a repro here: https://developercommunity.visualstudio.com
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1>  link!RaiseException()+0x6c
1>  link!RaiseException()+0x6c
1>  link!InvokeCompilerPassW()+0x8a967
1>  link!InvokeCompilerPass()+0x1ad9e3
1>  link!InvokeCompilerPass()+0x1c6d39
1>  link!InvokeCompilerPass()+0x1b0360
1>  link!InvokeCompilerPass()+0x1c7dcf
1>  link!InvokeCompilerPass()+0x1c3c6c
1>
1>Done building project "KFRTest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 1:42 AM and took 16.439 seconds ==========
dancazarin commented 12 months ago

Could you check this again with the latest version (clone the repo and checkout dev branch)? Some Internal compiler errors were fixed since the version in vcpkg.

dancazarin commented 11 months ago

In the current version the code you provided doesn't cause internal compiler error in Visual Studio. The issue can be closed as completed after confirmation from you.

aybe commented 11 months ago

Yep, thank you for the support :)