Problem: This is a follow-up to the force-inline discussion in https://github.com/bitcoin-core/secp256k1/pull/1859#pullrequestreview-4491819905.
Fix: Rename ALWAYS_INLINE to FORCE_INLINE, matching the secp256k1 follow-up naming, and gate forced inlining to optimized non-size builds.
We currently have only a few FORCE_INLINE call sites, and this PR changes those cases narrowly: optimized non-size builds keep forced inlining, while debug, no-inline, size-optimized, and unknown compiler modes fall back to plain inline.
Size check: Linux bitcoind sizes from the reproducer below.
| Config | Base | Guard |
|---|---|---|
| Debug | 202,587,200 | 202,313,624 |
| Release | 19,117,016 | 19,117,016 |
| RelWithDebInfo | 309,241,040 | 309,241,040 |
| MinSizeRel | 14,539,624 | 14,515,016 |
Reproducer:
<details><summary>`bitcoind` size comparisons</summary>
COMMITS="1a2523e901a6c7c876c8a0817601e77d83f394b9 0c4d6e95946626bffbd9f0e9587d5a9819dbdd77" && \
ROOT=$(mktemp -d) && OLD=$(git symbolic-ref --short -q HEAD || git rev-parse HEAD) && \
trap 'git switch -q "$OLD" 2>/dev/null || git switch -q --detach "$OLD"' EXIT && \
for commit in $COMMITS; do \
git switch -q --detach "$commit" && short=$(git rev-parse --short=12 HEAD) && \
for cfg in Debug Release RelWithDebInfo MinSizeRel; do \
b="$ROOT/$short-$cfg" && log="$b.log" && \
cmake -S . -B "$b" -G Ninja -DCMAKE_BUILD_TYPE="$cfg" >"$log" 2>&1 && \
cmake --build "$b" -j "$(nproc)" --target bitcoind >>"$log" 2>&1 && \
printf '%s %s %s\n' "$short" "$cfg" "$(stat -c%s "$b/bin/bitcoind")" || { cat "$log"; exit 1; }; \
done; \
done
</details>
Note: Rebase this change on #35215 to exercise more representative FORCE_INLINE call sites.