[Patch] Fix libstdc++/13450

Paolo Carlini pcarlini@suse.de
Tue Mar 9 17:24:00 GMT 2004


Hi,

so, here it is. Basically, I have adapted and tested submitter's patch,
which brings us back to the 3.2.x behavior + the optimization introduced
by Gaby for 3.3, carried out only when absolutely safe.

The important tweak wrt the original patch is the following:

  if (__x.imag() == _Tp() && __x.real() > _Tp())
                                        ^--------- instead of >=
    return pow(__x.real(), __y);

Without it, we may end up calling cmath's pow also when __x.real == -0
and, in general, this isn't safe (it's ok for C99 libcs, F.9.4.4).

An interesting twist of the work is that I have noticed that we weren't
running two testcases (!) due to a wrong suffix, the second particularly
important in order to verify that we are not regressing on 10689:
26_numerics/cmath/overloads.C and 26_numerics/complex/pow.C.

Tested x86-linux, I mean to double check the fix immediately on x86-64
too, and, if nobody objects, commit the work tomorrow.

Paolo.

///////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_13450
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040309/66ee4211/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_13450
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040309/66ee4211/attachment-0001.ksh>


More information about the Libstdc++ mailing list