True, that's what I mean with depending too much on the optimizer (in a sibling comment). But IME the threshold for inlining code is surprisingly big (which of course also has a downside: potential code bloat).
I added a little fix which prevents the compiler from discarding the result completely (just by going through __builtin_printf()):
https://godbolt.org/z/W93WrhbaE
PS: another minor tweak (make the comparison function static, so that no extra copy is included in the compiler output):
https://godbolt.org/z/5TTM4x193