https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101180
Bug ID: 101180 Summary: [12 Regression] Rejected code since r12-299-ga0fdff3cf33f7284 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- The code is reduced from Skia (part of chromium package): $ cat enc.ii #pragma GCC target "avx" template <typename> struct Simd {}; #pragma GCC push_options #pragma GCC target "avx,avx2,bmi,bmi2,fma,f16c" template <typename T> using Full256 = Simd<T>; template <typename> struct BitCastFromInteger256; template <> struct BitCastFromInteger256<float> { __attribute__((always_inline)) float operator()(long) { return .0f; } }; long BitCastFromByte_v_0; template <typename T> void BitCastFromByte(Full256<T>) { T{BitCastFromInteger256<T>()(BitCastFromByte_v_0)}; } template <typename T, typename FromT> void BitCast(T d, FromT) { BitCastFromByte(d); } int EstimateEntropy___trans_tmp_3; void EstimateEntropy() { Simd<float> df; BitCast(df, EstimateEntropy___trans_tmp_3); } #pragma GCC pop_options $ g++ enc.ii -c enc.ii: In function ‘void BitCastFromByte(Full256<T>) [with T = float]’: enc.ii:8:40: error: inlining failed in call to ‘always_inline’ ‘float BitCastFromInteger256<float>::operator()(long int)’: target specific option mismatch 8 | __attribute__((always_inline)) float operator()(long) { return .0f; } | ^~~~~~~~ enc.ii:12:31: note: called from here 12 | T{BitCastFromInteger256<T>()(BitCastFromByte_v_0)}; | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~