This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[critical libstdc++ regression]: Duplicate definitions with -On, n > 1



Both GCC-3.0 and GCC-3.1 fail to translate the program below when
optimization -On (n > 1) is on.  Every thing is fine with -O0.  The
problem shows up on a x86 using glibc-2.2.x.

The problem comes from the fact that glibc decides, when optimization
is on, to provide an __inline definition of fabs in bits/mathinline.h

__inline double fabs (double __x) throw () { return __builtin_fabs (__x); }

whereas V3 already has 

    inline double
    fabs(double __x) { return __builtin_fabs(__x); }

This passes silently until the assembler complains.

A fix would be to instruct glibc not to provide his own inline
definition of fabs --- that is bogus anyway, from V3 point of view.

Comments?

-- Gaby
CodeSourcery, LLC            http://www.codesourcery.com
     http://www.codesourcery.com/gcc-compile.shtml


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]