This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: complex arithmetic in gcc (and various standards)
On Mon, 2 Oct 2006, Paolo Carlini wrote:
> I'm not sure if the following is exactly Joseph' point, but I'd like to know
> your opinion about it anyway: if you look to Comment #19 in the audit trail of
> PR 28408, I noticed that, due to the rule about signed zero (with default
> rounding):
> (+0) + (-0) = +0
>
> the result of the "same" multiplication considered as complex * complex (vs
> complex * real) has a different sign for the zero imaginary component.
Yes, that's my point.
For C99, real*complex and complex*complex are two different operations and
neither should be converted into the other. At present we wrongly convert
the first into the present, and then sometimes wrongly optimize back.
--
Joseph S. Myers
joseph@codesourcery.com