
Rob Stewart wrote:
From: Felipe Magno de Almeida <felipe.m.almeida@gmail.com>
On 10/3/05, Rob Stewart <stewart@sig.com> wrote:
(Note that __assume(false) is useless, for it is an expression that the optimizer cannot use to optimize anything. So, while I understand that you were trying to simplify things for the discussion, let's also not lose sight of what is really meant when writing __assume(false) in the above examples.)
I think you're wrong. __assume(false) means that this code will never be executed, and as such isnt useless for the optimizer.
Hmmm. I guess you're right. Still, it only means that the code following __assume(false) can be elided, not any preceeding code, right?
The preceding code can be elided if the compiler can prove that it doesn't affect the reachability of __assume(false). ++x can, a function call cannot (in general) without whole program optimization.