This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16607] Incorrect FP code generated in member data initialization


------- Additional Comments From npr1 at suomi24 dot fi  2004-07-18 00:38 -------
(In reply to comment #3)
> Yes it is, read the whole bug next time.
> *** This bug has been marked as a duplicate of 323 ***

I'm sorry but I must insist on the opposite. I hope you'll spare me yet some 
more of your time and explain what I am thinking wrong, if this still doesn't 
make sense.

I've read all of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 a few times 
already, and agree that "bug" 323 (about x != y in floating point) is clearly a 
case of rounding. This bug has nothing to do with that.

You can see that my program prints two lines, each from an identical call to new 
C(y); In the flawed case (compiled with -O), the first printout is completely 
different from the second one which is correct. Between calls (and also in 
relation to x_ in the wrong case), the value of x changes by the printed value 
of ~1e-7 which is very much more than the precision of double x_ which has a 
value of ~2.7. The effect of rounding would be of the same magnitude as the 
double epsilon, less than 1e-15.

You should notice that there are no floats used after the initialization of 
const double y. There's no way the value in y or x_ could fluctuate more than 
the precision of a double.

I understand that your time is limited and seeing identical bug reports for non-
bugs is frustrating. I should have initially documented better why I think the 
result is invalid and not from rounding.

If all this is wrong, I wholeheartedly apologize and will stop reopening the 
bug. :)

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16607


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]