[llvm-dev] [isocpp-parallel] Proposal for new memory_order_consume definition
Linus Torvalds via llvm-dev
llvm-dev at lists.llvm.org
Sat Feb 27 11:16:51 PST 2016
On Feb 27, 2016 09:06, "Paul E. McKenney" <paulmck at linux.vnet.ibm.com>
wrote:
>
>
> But we do already have something very similar with signed integer
> overflow. If the compiler can see a way to generate faster code that
> does not handle the overflow case, then the semantics suddenly change
> from twos-complement arithmetic to something very strange. The standard
> does not specify all the ways that the implementation might deduce that
> faster code can be generated by ignoring the overflow case, it instead
> simply says that signed integer overflow invoked undefined behavior.
>
> And if that is a problem, you use unsigned integers instead of signed
> integers.
Actually, in the case of there Linux kernel we just tell the compiler to
not be an ass. We use
-fno-strict-overflow
or something. I forget the exact compiler flag needed for "the standard is
as broken piece of shit and made things undefined for very bad reasons".
See also there idiotic standard C alias rules. Same deal.
So no, standards aren't that important. When the standards screw up, the
right answer is not to turn the other cheek.
And undefined behavior is pretty much *always* a sign of "the standard is
wrong".
Linus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160227/074cc591/attachment.html>
More information about the llvm-dev
mailing list