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/21607] Optimizations convert 0 to -0 leading to difference in answers.


------- Additional Comments From fsmith at mathworks dot com  2005-05-16 13:48 -------
Created an attachment (id=8901)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8901&action=view)
Minimal self-contained C program exhibiting problem

The answer provided by this program changes depending on whether or
not optimizations are turned on.

The reason for the difference is that the value b changes between 0
and -0 depending on the optimization level.

Here is some sample output:
% gcc emtst_asinh_standalone.c
b = 0
atan(-7/b) = -1.5708
% gcc -O emtst_asinh_standalone.c
b = -0
atan(-7/b) = 1.5708
Error happened!


-- 


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


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