------- Comment #10 from pcarlini at suse dot de 2006-09-07 00:44 ------- I'm re-reading the various floating-point standards and Annexes and I think this issue may turn out to be a not-a-bug. Whether those standards make sense it's another matter ;) So, what I'm reading: C99, F.8.2 says that 0 * x and 0.0 are equivalent, i.e., tranforming 0 * x to 0.0 is allowed (insofar x is not a NaN, -0, or infinite). Therefore, it seems, the optimizers of a C / C++ compiler conforming to IEC 60559 (~ IEC 559) are allowed to do that replacement at any moment and "discard" the info about the signedness of x. As submitter maintains - correctly, in my opinion - when the same compiler implements complex functions sensitive to the signedness of zero, like in C99, G, for example, and supposedly compatible with the same IEC 60559, how that signedness info is kept or moved around should be a serious concern... In general, I'm under the impression, that signed zero has been invented to cope with specific discontinuities of specific functions and to improve the consistency of floating point computations involving infinities (interesting discussion, as usual, in Goldberg, 2.2.3), not as something which in every case is kept conceptually distinct from 0 during a computation: as a matter of fact, in such standards 0 and -0 compare equal...
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28408