[Bug tree-optimization/126467] [13/14/15/16/17 Regression] wrong code with folding 0.0 - x

"amonakov at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126467

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
No, the first sentence is in fact correct, x-y is the same as x+(-y), which by
commutativity is the same as (-y)+x. The problem is that positive zero is _not_
the neutral element for addition under default rounding, but negative zero is:

(0.0 + x) is not the same as x when x is -0.0

(-0.0 + x) and (x - 0.0) are the same as x under default rounding.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.