Observed
Two comments in src/buster/lib/compiler/frontend/c/c_gen.c contradict each other about how two-complex-operand * and / are lowered.
-
The complex overview, above the complex lowering helpers:
* and / with two complex operands call the compiler runtime -- __mulsc3/__muldc3/__multc3 and __divsc3/__divdc3/__divtc3 -- which is what Clang emits … calling them rather than inlining Smith's algorithm is the choice made here
-
The comment on c_ir_emit_complex_divide:
(a + bi) / (c + di) by Smith's algorithm, which is what Clang emits inline for -fcomplex-arithmetic=improved … Those helpers live in libgcc or compiler-rt, and this toolchain ships neither and links neither, so calling them would turn every complex multiply into an unresolved symbol at link time.
The code follows the second. No __mul?c3/__div?c3 symbol name appears anywhere in c_gen.c. A long double _Complex multiply/divide object built on c3f93e8 imports only the scalar quad routines (__multf3, __divtf3, …), and its results are bit-identical to Clang with -fcx-fortran-rules (improved range), not Clang's default. Checked while validating #1720.
Why it matters
The overview is the first thing a reader finds. It describes the opposite design and the opposite reference mode, which matters when triaging differences such as #1569 (large/tiny operands give NaN), where the choice between the Annex G helpers and inline Smith is the root question.
Done when
The overview bullet describes the inline Smith/-fcomplex-arithmetic=improved choice and points to c_ir_emit_complex_divide, or the code changes to match the overview. Comment-only; no behavior change.
Observed
Two comments in
src/buster/lib/compiler/frontend/c/c_gen.ccontradict each other about how two-complex-operand*and/are lowered.The complex overview, above the complex lowering helpers:
The comment on
c_ir_emit_complex_divide:The code follows the second. No
__mul?c3/__div?c3symbol name appears anywhere inc_gen.c. Along double _Complexmultiply/divide object built onc3f93e8imports only the scalar quad routines (__multf3,__divtf3, …), and its results are bit-identical to Clang with-fcx-fortran-rules(improved range), not Clang's default. Checked while validating #1720.Why it matters
The overview is the first thing a reader finds. It describes the opposite design and the opposite reference mode, which matters when triaging differences such as #1569 (large/tiny operands give NaN), where the choice between the Annex G helpers and inline Smith is the root question.
Done when
The overview bullet describes the inline Smith/
-fcomplex-arithmetic=improvedchoice and points toc_ir_emit_complex_divide, or the code changes to match the overview. Comment-only; no behavior change.