Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-10-03 16:40:51


Rob Stewart wrote:
> From: Felipe Magno de Almeida <felipe.m.almeida_at_[hidden]>
>> On 10/3/05, Rob Stewart <stewart_at_[hidden]> 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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk