This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Builtins and C++ and such
- From: Bernard Dautrevaux <Dautrevaux at microprocess dot com>
- To: 'Jason Merrill' <jason at redhat dot com>, Gabriel Dos Reis <gdr at codesourcery dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc at gcc dot gnu dot org, bkoz at redhat dot com
- Date: Wed, 20 Mar 2002 11:34:07 +0100
- Subject: RE: Builtins and C++ and such
> -----Original Message-----
> From: Jason Merrill [mailto:jason@redhat.com]
> Sent: Wednesday, March 20, 2002 11:20 AM
> To: Gabriel Dos Reis
> Cc: Mark Mitchell; gcc@gcc.gnu.org; bkoz@redhat.com
> Subject: Re: Builtins and C++ and such
>
>
> >>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
>
> > I'm strongly of the opinion of Jason that, even though the ideal
> > would be to have the library do most of the dirty work, the compiler
> > ought to assist us through some extensions.
>
> Actually, I disagree about the ideal. I think the compiler
> is The Right
> Place for this stuff.
>
> > Here is a fourth suggestion.
> > Suppose for a moment that the compiler is smart enought (or can be
> > made smart) to replace a reference to a function by the
> > referenced function where possible, then we could say:
>
> > void(&memcpy)(void*, const void*, size_t) = __builtin_memcpy;
>
> Again, this would involve putting the library through
> contortions in order
> to tell the compiler about itself.
And IMHO gcc nowhere has a list of all builtins, with a guarantee this will
*never* change on *any* target, so the library will have to go in infinite
contorsions to keep with the compilers and various targets...
FWIW I think the compiler is the one that *creates* the problem with
builtins, used as an internal optimization. It is then the one that have
cope with their proper semantics/usefulness.
Bernard
--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel: +33 (0) 1 47 68 80 80
Fax: +33 (0) 1 47 88 97 85
e-mail: dautrevaux@microprocess.com
--------------------------------------------