On Fri, 29 Aug 2014 05:31:00 +0000 deadalnix via Digitalmars-d <[email protected]> wrote:
> If the value in unspecified, rather than the behavior undefined,
> it means that no load or store can be optimized away or
> reordered, unless the compiler can prove that is won't fault.
will it really hurt most programs? compiler is still be able to remove
unused assignments, dead code and so on. and turning `while (v) {}` to
`while (true) {}` too, btw, so no, not 'volatile'.
and i can't see why it should prevent load reordering too. what it
actually forbids is throwing away overflow checks like 'if (a+100 < a)'
-- the same effect as '-fwrapv'.
aliasing sux too: only a small fraction of code gains something from
optimisations based on aliasing rules, yet that rules pushed down the
throat for everyone.
those who need speed will be able to use 'C with UB' (and chase
mysterious bugs) and majority of people will get much nicer C language
to write their code.
current C is anti-human.
signature.asc
Description: PGP signature
