Observed
long double g(int n, long double first, ...) { return first; }
long double call(void) { return g(1, 2.0L, 3); }
$ build/Release/ide cc -c -target x86_64-linux v.c
cc: error: v.c:1:13: C IR lowering does not yet support the parameter or return value types of function 'g'
Clang 18 (--target=x86_64-linux-gnu) accepts it. The refusal is deliberate. c_ir_signature_body_supported in src/buster/lib/compiler/frontend/c/c_gen.c rejects any wide-float fixed parameter of a variadic signature ("The canonical SysV va_start path cannot account for a fixed x87 parameter yet"), and c_parse_validate_signature in c_parse.c mirrors it. Passing long double variadically already works on SysV. Only a named one before ... is refused.
On System V a named x87 long double occupies a 16-byte slot in the overflow (stack) area, so va_start must start its overflow_arg_area after it. gp_offset/fp_offset are unaffected.
#1720 lifted the same restriction for AAPCS64 binary128, where a named binary128 uses a V register like a 16-byte vector. This issue is the x87 half.
Expected
The definition and the call compile and match Clang objects in both call directions. That includes a named long double that spills to the stack after other stack arguments.
Details
Done when
The mirror and lowering gates admit the x87 shape, the canonical and MIR va_start account for the overflow slot, and a mixed-compiler fixture (Buster caller ↔ Clang callee and back) reads variadic arguments correctly after one or two named long doubles.
Observed
Clang 18 (
--target=x86_64-linux-gnu) accepts it. The refusal is deliberate.c_ir_signature_body_supportedinsrc/buster/lib/compiler/frontend/c/c_gen.crejects any wide-float fixed parameter of a variadic signature ("The canonical SysV va_start path cannot account for a fixed x87 parameter yet"), andc_parse_validate_signatureinc_parse.cmirrors it. Passinglong doublevariadically already works on SysV. Only a named one before...is refused.On System V a named x87
long doubleoccupies a 16-byte slot in the overflow (stack) area, sova_startmust start itsoverflow_arg_areaafter it.gp_offset/fp_offsetare unaffected.#1720 lifted the same restriction for AAPCS64 binary128, where a named binary128 uses a V register like a 16-byte vector. This issue is the x87 half.
Expected
The definition and the call compile and match Clang objects in both call directions. That includes a named
long doublethat spills to the stack after other stack arguments.Details
c3f93e8(branch of aarch64: lower binary128 long double through the compiler runtime #1720, unchanged for x86-64); Linux x86-64.Done when
The mirror and lowering gates admit the x87 shape, the canonical and MIR
va_startaccount for the overflow slot, and a mixed-compiler fixture (Buster caller ↔ Clang callee and back) reads variadic arguments correctly after one or two namedlong doubles.