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]

Re: optimization/8635: incorrect optimization of 0.0 * Infinity


Synopsis: incorrect optimization of 0.0 * Infinity

State-Changed-From-To: open->closed
State-Changed-By: zlomek
State-Changed-When: Thu Dec  5 00:32:47 2002
State-Changed-Why:
    When compiling with -O the variables are kept in coprocessor registers which are more exact that doubles (they are as exact as long doubles). Compiler is allowed to keep the values more exact. Although the value is infinite for doubles, it is finite for long doubles and thus 0.0 * (large but finite) = 0.
    I also tried to make a long double infinite and it worked as expected: 0.0 * inf = nan
    
    (the reason why the result with -O0 was nan is that the register was stored to memory as double and loaded again so when converting large number to doubles it became inf)
    
    Josef Zlomek

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8635


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