After r261754, older compilers (GCC up to 9.x) complain about the `sources` parameter being set but not used when NumberOfRegisters is zero. The same may happen to destinations when both NumberOfRegisters is zero and ASSERT_ENABLE is false. Example: In file included from ../../Source/JavaScriptCore/jit/Snippet.h:31, from ../../Source/JavaScriptCore/domjit/DOMJITCallDOMGetterSnippet.h:31, from ../../Source/JavaScriptCore/domjit/DOMJITGetterSetter.h:28, from ../../Source/JavaScriptCore/runtime/Lookup.h:26, from ../../Source/JavaScriptCore/runtime/JSObjectInlines.h:32, from ../../Source/JavaScriptCore/runtime/JSCInlines.h:48, from ../../Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp:29, from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f0a787a9-9.cpp:3: ../../Source/JavaScriptCore/jit/CCallHelpers.h: In instantiation of ‘void JSC::CCallHelpers::setupStubArgs(std::array<RegType, NumberOfRegisters>, std::array<RegType, NumberOfRegisters>) [with unsigned int NumberOfRegisters = 0; RegType = JSC::X86Registers::RegisterID]’: ../../Source/JavaScriptCore/jit/CCallHelpers.h:645:9: required from ‘void JSC::CCallHelpers::setupArgumentsImpl(JSC::CCallHelpers::ArgCollection<numGPRArgs, numGPRSources, numFPRArgs, numFPRSources, numCrossSources, extraGPRArgs, extraPoke>) [with OperationType = void(JSC::VM*); unsigned int numGPRArgs = 1; unsigned int numGPRSources = 0; unsigned int numFPRArgs = 0; unsigned int numFPRSources = 0; unsigned int numCrossSources = 0; unsigned int extraGPRArgs = 0; unsigned int extraPoke = 0]’ ../../Source/JavaScriptCore/jit/CCallHelpers.h:585:13: required from ‘std::enable_if_t<(std::is_base_of<JSC::AbstractMacroAssembler<JSC::X86Assembler>::TrustedImm, Arg>::value || std::is_convertible<Arg, JSC::AbstractMacroAssembler<JSC::X86Assembler>::TrustedImm>::value)> JSC::CCallHelpers::setupArgumentsImpl(JSC::CCallHelpers::ArgCollection<numGPRArgs, numGPRSources, numFPRArgs, numFPRSources, numCrossSources, extraGPRArgs, extraPoke>, Arg, Args ...) [with OperationType = void(JSC::VM*); unsigned int numGPRArgs = 0; unsigned int numGPRSources = 0; unsigned int numFPRArgs = 0; unsigned int numFPRSources = 0; unsigned int numCrossSources = 0; unsigned int extraGPRArgs = 0; unsigned int extraPoke = 0; Arg = JSC::AbstractMacroAssembler<JSC::X86Assembler>::TrustedImmPtr; Args = {}; std::enable_if_t<(std::is_base_of<JSC::AbstractMacroAssembler<JSC::X86Assembler>::TrustedImm, Arg>::value || std::is_convertible<Arg, JSC::AbstractMacroAssembler<JSC::X86Assembler>::TrustedImm>::value)> = void]’ ../../Source/JavaScriptCore/jit/CCallHelpers.h:675:9: required from ‘std::enable_if_t<(! std::is_same<typename WTF::FunctionTraits<T>::ArgumentType<0>, JSC::CallFrame*>::value)> JSC::CCallHelpers::setupArguments(Args ...) [with OperationType = void(JSC::VM*); Args = {JSC::AbstractMacroAssembler<JSC::X86Assembler>::TrustedImmPtr}; std::enable_if_t<(! std::is_same<typename WTF::FunctionTraits<T>::ArgumentType<0>, JSC::CallFrame*>::value)> = void]’ ../../Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp:215:106: required from here ../../Source/JavaScriptCore/jit/CCallHelpers.h:90:130: warning: parameter ‘sources’ set but not used [-Wunused-but-set-parameter] 90 | ALWAYS_INLINE void setupStubArgs(std::array<RegType, NumberOfRegisters> destinations, std::array<RegType, NumberOfRegisters> sources) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Created attachment 399614 [details] Patch
Comment on attachment 399614 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399614&action=review > Source/JavaScriptCore/jit/CCallHelpers.h:111 > + // Silence some older compilers (GCC up to 9.X) about unused but set parameters. > + (void)sources; > + (void)destinations; We have standard idiom for this: see uses of UNUSED_PARAM in the code.
Created attachment 399619 [details] Updated patch with UNUSED_PARAM
Committed r261797: <https://trac.webkit.org/changeset/261797> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399619 [details].
<rdar://problem/63327291>
Thanks for keeping the build clean. :)