This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: GCC viciously beaten by ICC in trig test!


Paolo Carlini <pcarlini@suse.de> writes:

| Ian Lance Taylor wrote:
| 
| >The C++ library relies on the details of the C++ compiler
| >far more than the C library relies on the details of the C compiler.
| >Even today libstdc++-v3 uses at least one g++ extension--
| >attribute((strong)).
| >
| All in all I'm not sure to fully agree...
| 
| Actually, attribute((strong)) is a *recent* entry, only to support debug
| mode, which I find really great! but not part of the core functionalities,
| those mandated by the standard.

Agreed.

| Otherwise, a bunch of builtin_expect (glibc also uses that, right?... and we
| don't even agree that they are always so beneficial in our case), a bunch of
| builtin_alloca, quite useful I admit, what else?

The primary reasons we're using the mojority of __builtin_xxx stuff in
V3 is precisely because we don't have control over the C library so we
use those in the hope that the compiler will forward them to the "right"
functions. The optimization argument is secondary.  The use of
__builtin_expect() is largely (early) optimization based on speculation and
could be removed without damaging the library.  __builtin_alloca is
used as a *convienient* allocation routine on the stack.  It could be
replaced with malloc/free pair. (I don't suggest that though).

The real part tied to the compiler is libsupc++, but that is precisely
the part required in any freestanding implementation -- just like the
C standard requires part of its library to be included in freestanding
implementations.   The rest of the library is much much larger.

-- Gaby
 


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