------- Comment #2 from rob1weld at aol dot com  2007-06-20 16:46 -------
This bug report is titled 'GCC Collect2 adds extra "-lm"'s to link commands
even when not linking with "-lm".'.


The page http://gcc.gnu.org/gcc-4.3/changes.html#mpfropts says:

The GCC middle-end has been integrated with the MPFR library. This allows GCC
to evaluate and replace at compile-time calls to built-in math functions having
constant arguments with their mathematically equivalent results. In making use
of MPFR, GCC can generate correct results regardless of the math library
implementation or floating point precision of the host platform. This also
allows GCC to generate identical results regardless of whether one compiles in
native or cross-compile configurations to a particular target. The following
built-in functions take advantage of this ...


> Andrew Pinski 2007-06-20 12:55 [reply] ------- 
> No it does not say that, please stop reading the changes page incorrectly. 
> What it is saying is that inside the compiler, GCC will now do constant 
> folding.

The word "fold" or "folding" does not appear on that page.

It does say:

"evaluate and replace at compile-time calls to built-in math functions having
constant arguments with their ..."

"The sqrt and cabs functions with constant arguments were already optimized in
prior GCC releases. Now they also use MPFR."

Is that so different from saying that it uses mpfr instead of libm ?


This bug report is titled 'GCC Collect2 adds extra "-lm"'s to link commands
even when not linking with "-lm".'.

Even if we disagree on the libm vs. mpfr issue it does not explain that
collect2 tosses in extra "-lm"'s when the files do NOT have any calls to libm
(since it was removed in _my_ modified test version).

What if we want to link with another math library and the function names
conflict, we would not want "-lm" to overwrite them.


-- 

rob1weld at aol dot com changed:

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


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

Reply via email to