Date: Thu, 18 Sep 2025 13:59:25 -0700
On Thursday, 18 September 2025 03:55:01 Pacific Daylight Time David Brown via
Std-Discussion wrote:
> A tight infinite loop (like gcc) would be reasonable,
> as would an "UB" or trap instruction that guarantees a program halt on a
> hosted OS like Linux is a better choice.
One could reason the opposite. This is the case of the time-travelling UB: the
compiler is allowed to reason UBs never happen, so it is allowed to eliminate
all code paths that would have led there. That implies Clang implemented the
infinite loop as obscure way to write:
__builtin_unreachable();
Std-Discussion wrote:
> A tight infinite loop (like gcc) would be reasonable,
> as would an "UB" or trap instruction that guarantees a program halt on a
> hosted OS like Linux is a better choice.
One could reason the opposite. This is the case of the time-travelling UB: the
compiler is allowed to reason UBs never happen, so it is allowed to eliminate
all code paths that would have led there. That implies Clang implemented the
infinite loop as obscure way to write:
__builtin_unreachable();
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Platform & System Engineering
Received on 2025-09-18 20:59:38