|
From: | Marcin Dalecki |
Subject: | Re: GCC optimizes integer overflow: bug or feature? (was: avoid integer overflow in mktime.m4) |
Date: | Wed, 20 Dec 2006 12:15:29 +0100 |
On 2006-12-20, at 00:10, Richard B. Kreckel wrote:
C89 did not refer to IEEE 754 / IEC 60559. Yet, as far as I am aware,-ffast-math or the implied optimizations have never been turned on by GCCunless explicitly requested. That was a wise decision. By the same token it would be wise to refrain from turning on any optimization that breaks programs which depend on wrapping signed integers.
Numerical stability of incomplete floating point representations are an entirely different problem category then some simple integer tricks. In the first case the difficulties are inherent to the incomplete representation of the calculation domain. In the second case it's just some peculiarities of the underlying machine as well as the fact that the unsigned qualifier is not used nearly enough frequently in common code. Or in other words: Z/32 resp. 64 IS AN ALGEBRA but
float isn't! Thus this argument by analogy simply isn't valid. Marcin Dalecki
[Prev in Thread] | Current Thread | [Next in Thread] |