[Bug c/48874] Sign of zeros sometimes lost in literals

jb at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 4 17:15:00 GMT 2011


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

Janne Blomqvist <jb at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #3 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-05-04 17:03:56 UTC ---
Ah, I see. while sizeof(I) == 8, due to the addition it gets expanded to (0.0,
1.0), and then, as you say, the negative zero is lost. So to generate the
literal constant (-0, 0) one needs

  double _Complex c2 = -(0.0 - I*0.0);

Thank you both for the explanation.



More information about the Gcc-bugs mailing list