Subject: Re: [ub] A proposal to define signed overflow submitted?
From: Hyman Rosen (hyman.rosen_at_[hidden])
Date: 2018-03-15 00:24:06
On Wed, Mar 14, 2018 at 6:50 PM, Aaron Ballman <aaron_at_[hidden]>
> Infinite loops are undefined behavior because you'd have to solve the
> halting problem in order to determine whether any given code path is
> dynamically reachable. So presence of an infinite loop is UB in order
> to allow optimizers to generate code assuming the behavior never
As soon as you mention the word "optimizer" you are lost.
Compilers don't need to solve anything. All they need to do is to model the
abstract machine on the underlying computer. If the abstract machine
an infinite loop, so does the computer. As the programmer wrote it.
SG12 list run by firstname.lastname@example.org