[Bug other/42333] complex division failure on darwin10 with -lm

ghazi at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Dec 9 00:07:00 GMT 2009



------- Comment #14 from ghazi at gcc dot gnu dot org  2009-12-09 00:06 -------
(In reply to comment #11)
> I think I understand why apple gcc42 does not show the problem: it does not
> call ___divdc3:

It is possible that some versions of GCC (Apple's and/or FSF's) inline the
assembly code to do the divide.  That would explain why they don't call
___divdc3.  Then what happens only depends on what version of the algorithm
they inline, not what they link against.


> ...
> This also explain why the test compiled with -c and 4.5, but linked with 4.2
> fails. So my guess about the lazy complex division seems right in libm. Could
> someone write a C code forcing the use of ___divdc3?

I don't think it makes sense to consider user code calling ___divdc3 directly. 
According to the C standard, functions that begin with double underscore are
reserved for the compiler and/or system libraries.  That is exactly how they
are being used here.  The call should only be generated by the compiler itself
as a service function to perform something like a complex divide.


-- 


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



More information about the Gcc-bugs mailing list