Friendly-C

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 28 23:08:42 PDT 2014


On Fri, 29 Aug 2014 05:31:00 +0000
deadalnix via Digitalmars-d <digitalmars-d at puremagic.com> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140829/144847a2/attachment-0001.sig>


More information about the Digitalmars-d mailing list